var scriptPath='/script';var photoFileTypes=['jpg','png','gif','bmp','jpeg'];var baseTypes=["int","integer","long","bool","boolean","float","long","date","double","string","map"];function isBaseType(type){for(var i=0;i<baseTypes.length;++i){if(baseTypes[i]==type)return true;}
return false;}
function StringBuffer(){this._strings_=new Array;}
StringBuffer.prototype.append=function(str){this._strings_.push(str);};StringBuffer.prototype.toString=function(){return this._strings_.join("");};String.prototype.getLength=function(){var o=this;var elen;if(typeOf(o.length)=="number")
elen=o.length;else elen=o.length();return elen;};function getBrowserURL(){if(location.href.lastIndexOf('/')!=-1){firstpos=location.href.lastIndexOf('/')+1;lastpos=location.href.length;return location.href.substring(0,firstpos);}
return"";}
function callBack(functionName,ev){if(typeOf(functionName)=='string')
return eval(functionName(ev));else
return functionName(ev);}
function popupCenterWindow(url,name,width,height,scro){var win=null;var left=(screen.width-width)/2;var top=(screen.height-height)/2;var features='height='+height+',';features+='width='+width+',';features+='top='+top+',';features+='left='+left+',';features+='scrollbars= '+scro+',';features+='resizable=no';win=window.open(url,name,features);if(parseInt(navigator.appVersion)>=4){win.window.focus();}
return win;}
function createElement(xmlStr){if(!xmlStr)return null;var xmlDom=false;if(window.ActiveXObject){var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];for(var i=0;i<prefixes.length;i++)
try{xmlDom=new ActiveXObject(prefixes[i]+".DomDocument");if(xmlDom)break;}
catch(ex){xmlDom=new ActiveXObject("Microsoft.XMLDOM");}}else if(document.implementation&&document.implementation.createDocument){xmlDom=document.implementation.createDocument("","doc",null);}
xmlDom.async=false;try{xmlDom.loadXML(xmlStr);}
catch(e){var oParser=new DOMParser();xmlDom=oParser.parseFromString(xmlStr,"text/xml");}
return xmlDom;}
Array.implement({setOptions:function(select,sel,keyf){if(typeOf(select)=='element')select.deleteOptions();if(keyf==null||keyf==undefined)keyf=":";var keys=null,vars=null,opt=null;function ie6OptionSelected(){this.selected=true;}
this.each(function(av){if(typeOf(av)=="string"){var hav=av.indexOf(keyf);if(hav==-1){opt=new Option(av,av);if(av==sel)
if(Browser.ie6)
ie6OptionSelected.delay(1,opt);else opt.selected=true;}else{keys=av.substring(0,hav);vars=av.substring(hav+1,av.getLength());opt=new Option(vars,keys);if(keys==sel){if(Browser.ie6)
ie6OptionSelected.delay(1,opt);else opt.selected=true;}}}else{opt=new Option(av.key,av.value);if(keys==sel)
if(Browser.ie6)
ie6OptionSelected.delay(1,opt);else opt.selected=true;}
if(typeOf(select)=='element')select.options.add(opt);else alert(select+' not find '+typeOf(select)+"  "+select);});},remove:function(dx)
{if(isNaN(dx)||dx>this.length){return false;}
for(var i=0,n=0;i<this.length;i++)
{if(this[i]!=this[dx])
{this[n++]=this[i]}}
this.length-=1}});String.prototype.selectors=function(sp){if(sp==undefined)sp=";";var str=this;var result='';if(str.indexOf(sp)!=-1){var array=str.toArray(sp);array.each(function(a){result=result+'#'+a+',';});}else result=this;return result;};String.prototype.deleteHtml=function(len,end){var result=this.replace(/<[^>].*?>/g,"").trim();if(!len)return result;if(!end)end='';return result.cut(len,end);};String.prototype.cleanWord=function(){var html=this.replace(/<\/?chsdate[^>]*>/gi,"");html=html.replace(/<\/?SPAN[^>]*>/gi,"");html=html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<\\?\?xml[^>]*>/gi,"");html=html.replace(/&lt;\\?\?xml:namespace[^>]*>/gi,"");html=html.replace(/<\/?\w+:[^>]*&gt;/gi,"");html=html.replace(/&nbsp;/," ");var re=new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi");return html.replace(re,"<div$2</div>").replace(/<p \/>/gi,"");};String.prototype.cut=function(len,send){if(send==undefined)send="";if(this.getCLength()>len-send.length)
return this.csubstring(0,(len-send.length))+send;else return this;};String.prototype.getCLength=function(){return this.replace(/[^\x00-\xff]/g,"**").length;};String.prototype.csubstring=function(start,len){var result="";var chineseRegex=/[^\x00-\xff]/g;var strLength=this.replace(chineseRegex,"**").length;var newLength=0;for(var i=0;i<strLength;i++){var singleChar=this.charAt(i).toString();if(singleChar.match(chineseRegex)!=null)newLength+=2;else newLength++;if(len&&newLength>len)break;if(newLength>=start)result+=singleChar;}
return result;};String.prototype.firstUpperCase=function(){return this.substring(0,1).toUpperCase()+this.substring(1,this.length);};String.prototype.firstLowerCase=function(){return this.substring(0,1).toLowerCase()+this.substring(1,this.length);};String.prototype.getLength=function(){var o=this;var elen;if(typeOf(o.length)=="number")elen=o.length;else elen=o.length();return elen;};String.prototype.substringBefore=function(prefix){if(this==null||prefix==undefined)return"";var pos=this.indexOf(prefix);if(pos==-1)
return"";return this.substring(0,pos);};String.prototype.substringAfter=function(prefix){if(this==null||prefix==undefined)return"";var pos=this.indexOf(prefix);if(pos==-1)return"";return this.substring(pos+1,this.length);};String.prototype.substringLastAfter=function(prefix){if(this==null||prefix==undefined)return"";var pos=this.lastIndexOf(prefix);if(pos==-1)
return"";return this.substring(pos+prefix.getLength(),this.getLength());};String.prototype.getFileType=function(){var fileType=this.substringLastAfter(".").toLowerCase();if(fileType.indexOf('?')==-1)return fileType;return fileType.substringBefore("?");};String.prototype.getFileName=function(){var pos=this.lastIndexOf('/');if(pos!=-1)return this.substring(pos+1,this.length);return this;};String.prototype.countMatches=function(c){var elen=this.getLength();var clen=c.getLength();if(!this||elen<1)return 0;if(elen<clen)return 0;var result=0;for(var i=0;i<elen-clen;i++){if(c==this.substring(i,i+clen))result++;}
return result;};String.prototype.parseInt=function(separator){var result=0;if(separator&&this.lastIndexOf(separator)!=-1){firstpos=this.lastIndexOf(separator)+separator.getLength();lastpos=this.getLength();result=parseInt(this.substring(firstpos,this.getLength()));if(isNaN(result))return 0;return result;}
result=parseInt(this.replace("px",""));if(isNaN(result))return 0;return result;};String.prototype.toNumber=function(dec){var f=this.replace("px","");if(dec<0)dec=2;var result=parseInt(this)+(dec==0?"":".");f-=parseInt(f);if(f==0)
for(var i=0;i<dec;i++)result+='0';else{for(i=0;i<dec;i++)f*=10;result+=parseInt(Math.round(f));}
return result;};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'');};String.prototype.toBoolean=function(){if(this=='')return false;var temp=this.toLowerCase();return temp=='true'||temp=='1'||temp=='y';};String.prototype.isEmpty=function(){return(this==null)||this==undefined||(this.getLength()<1);};String.prototype.isChinese=function(){return/^[\u0391-\uFFE5]+$/.test(this);};String.prototype.isDate=function(){if(""==this)return false;return new Date(Date.parse(this)).isValid();};String.prototype.isTime=function(){var a=this.match(/^(\d{1,2})(:)?(\d{1,2})$/);if(a==null)return false;return!(a[1]>24||a[3]>60);};String.prototype.isEmail=function(){if(this.isEmpty()){return false;}
var re=/^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i;return re.test(this);};String.prototype.indexOfArray=function(array){if(typeOf(array)=="string")return this.indexOf(array);for(var i=0;i<array.length;i++){if(this.indexOf(array[i])!=-1)return true;}
return false;};String.prototype.isGoodName=function(){if(!this.isLengthBetween(2,50))return false;return!this.indexOfArray(['.','/',',',';','.',' ','^','&','|','[',']','!']);};String.prototype.isURL=function(){var reg=/^http:\/\/.{0,93}/;var reg2=/^https:\/\/.{0,93}/;var reg3=/^rtsp:\/\/.{0,93}/;var reg4=/^mms:\/\/.{0,93}/;return reg.test(this)||reg2.test(this)||reg3.test(this)||reg4.test(this);};String.prototype.startsWith=function(str,formI){return this.substr(formI,str.length)==str;};String.prototype.endWith=function(prefix){if(this==null)return false;if(typeOf(prefix)=="string"){return this.substring(this.getLength()-prefix.getLength(),this.getLength())==prefix;}else{for(var i=0;i<prefix.length;i++){if(this.substring(this.getLength()-prefix[i].getLength(),this.getLength())==prefix[i])
return true;}
return false;}};String.prototype.isMobile=function(){var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;return patrn.exec(this);};String.prototype.isQQ=function(){var patrn=/^[1-9]\d{4,8}$/;return patrn.exec(this);};String.prototype.isPhone=function(){var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;return patrn.exec(this);};String.prototype.isPostcode=function(){var patrn=/^[a-zA-Z0-9 ]{3,12}$/;return patrn.exec(this);};String.prototype.isInteger=function(){var patrn=/^[-\+]?\d+$/;return patrn.exec(this);};String.prototype.isFloat=function(){return this.isDouble();};String.prototype.isDouble=function(){var patrn=/^[-\+]?\d+(\.\d+)?$/;return patrn.exec(this);};String.prototype.isEnglish=function(){var patrn=/^[A-Za-z]+$/;return patrn.exec(this);};String.prototype.isSafe=function(){var patrn=/^(([A-Z]*|[a-z]*|\d*|[-_\~!@#\$%\^&\*\.\(\)\[\]\{\}<>\?\\\/\'\"]*)|.{0,5})$|\s/;return!patrn.exec(this);};String.prototype.isIP=function(){var re=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g;if(re.test(this)){if(RegExp.$1<256&&RegExp.$2<256&&RegExp.$3<256&&RegExp.$4<256)return true;}
return false;};String.prototype.test=function(regex,params){return((typeOf(regex)=='string')?new RegExp(regex,params):regex).test(this);};String.prototype.equal=function(v){return this==v;};String.prototype.isNumber=function(){var objExp=/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;return objExp.test(this);};String.prototype.isBetween=function(imin,imax){if(!this.isNumber())return false;return parseFloat(this).isBetween(imin,imax);};String.prototype.isLengthBetween=function(iMin,iMax){return(this.length>=iMin)&&(this.length<=iMax);};String.prototype.isDateTime=function(){var r,d;if(this.countMatches(':')==2){r=this.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/);d=new Date(r[1],r[3]-1,r[4],r[5],r[6],r[7]);return(d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]&&d.getSeconds()==r[7]);}
if(this.countMatches(':')==1){r=this.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2})$/);d=new Date(r[1],r[3]-1,r[4],r[5],r[6],0);return(d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]);}
if(this.countMatches(':')==0)
return this.isDate();};String.prototype.isCardCode=function(){var intStrLen=this.getLength();if((intStrLen!=15)&&(intStrLen!=18))return false;var factorArr=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1);var varArray=new Array();var lngProduct=0;var intCheckDigit;var idNumber=this;for(var i=0;i<intStrLen;i++){varArray[i]=idNumber.charAt(i);if((varArray[i]<'0'||varArray[i]>'9')&&(i!=17)){return false;}else if(i<17){varArray[i]=varArray[i]*factorArr[i];}}
if(intStrLen==18){var date8=idNumber.substring(6,14);if(!date8.isDate())return false;for(i=0;i<17;i++)lngProduct=lngProduct+varArray[i];intCheckDigit=12-lngProduct%11;switch(intCheckDigit){case 10:intCheckDigit='X';break;case 11:intCheckDigit=0;break;case 12:intCheckDigit=1;break;}
if(varArray[17].toUpperCase()!=intCheckDigit)return false;}
else{var date6=idNumber.substring(6,12);if(!date6.isDate())
return false;}
return true;};String.prototype.checkPassWordLevel=function(){var n=0;if(/\d/.test(this))n++;if(/[a-z]/.test(this))n++;if(/[A-Z]/.test(this))n++;if(this.length==6)n=1;return n;};String.prototype.checkPassWordLevel1=function(){var grade=0;if(this.length>=6&&this.length<=9)grade=1;if(this.length>=10&&this.length<=15)grade=2;if(this.length>=16&&this.length<=20)grade=3;return grade;};String.prototype.show=function(sel){return this.split(";").show(sel);};String.prototype.toArray=function(sp){if(sp==null||sp==undefined){var charArr=new Array();for(var i=0;i<this.getLength();i++)charArr[i]=this.charAt(i);return charArr;}
return this.split(sp);};String.prototype.xmlEscape=function(){var str=this;str=str.replace(/&/g,'&amp;');str=str.replace(/</g,'&lt;');str=str.replace(/>/g,'&gt;');str=str.replace(/"/g,'&quot;');return str;};String.prototype.url=function(){return encodeURI(this);};String.prototype.toDate=function(){return Date.parse(this);};String.prototype.getQueryString=function(name){var result=this.match(new RegExp("[\?\&]"+name+"=([^\&]+)","i"));if(result==null||result.length<1){return"";}
return result[1];};Number.prototype.toInt=function(){return this.round(0);};Number.prototype.round=function(pos){return Math.round(this*Math.pow(10,pos))/Math.pow(10,pos);};Number.prototype.toDate=function(){return new Date(this);};Number.prototype.toDateString=function(fm){var date=new Date(this);return date.string(fm);};Number.prototype.string=function(y,n){if(this>0)return y;else return n;};Number.prototype.abs=function(){return Math.abs(this);};Number.prototype.isBetween=function(imin,imax){return imin<=this&this<=imax;};Number.prototype.toFloat=function(){return parseFloat(this);};Number.prototype.compareHour=function(beginDate){var lbegin=0;if(typeOf(beginDate)=="number")lbegin=beginDate;else lbegin=beginDate.getTime();var diffMillis=this-lbegin;return diffMillis/(60*60*1000);};Number.prototype.compareDay=function(beginDate){var diffMillis=this.compareHour(beginDate);return diffMillis/24;};Number.prototype.indexOfArray=function(array){for(var i=0;i<array.length;i++){if(this==array[i])return true;}
return false;};Date.prototype.string=function(format,def){if(this.getFullYear()<=1800&&this.getMonth()<2&&this.getDate()==1)return def;return this.string(format);};Date.prototype.string=function(formatStr){var date=this;var zeroize=function(value,length){if(!length){length=2;}
value=new String(value);for(var i=0,zeros='';i<(length-value.length);i++){zeros+='0';}
return zeros+value;};return formatStr.replace(/"[^"]*"|'[^']*'|\b(?:d{1,4}|M{1,4}|yy(?:yy)?|([hHmstT])\1?|[lLZ])\b/g,function($0){switch($0){case'd':return date.getDate();case'dd':return zeroize(date.getDate());case'ddd':return['Sun','Mon','Tue','Wed','Thr','Fri','Sat'][date.getDay()];case'dddd':return['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][date.getDay()];case'M':return date.getMonth()+1;case'MM':return zeroize(date.getMonth()+1);case'MMM':return['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][date.getMonth()];case'MMMM':return['January','February','March','April','May','June','July','August','September','October','November','December'][date.getMonth()];case'yy':return(date.getFullYear()+'').substr(2);case'yyyy':return date.getFullYear();case'h':return date.getHours()%12||12;case'hh':return zeroize(date.getHours()%12||12);case'H':return date.getHours();case'HH':return zeroize(date.getHours());case'm':return date.getMinutes();case'mm':return zeroize(date.getMinutes());case's':return date.getSeconds();case'ss':return zeroize(date.getSeconds());case'l':return date.getMilliseconds();case'll':return zeroize(date.getMilliseconds());case'tt':return date.getHours()<12?'am':'pm';case'TT':return date.getHours()<12?'AM':'PM';}});};Date.prototype.compareHour=function(beginDate){var diffMillis=this.getTime()-beginDate.getTime();return diffMillis/(60*60*1000);};Date.prototype.compareDay=function(beginDate){var diffMillis=this.getTime()-beginDate.getTime();return diffMillis/(24*60*60*1000);};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.between=function(beginDate,end){var ltime=this.getTime();var lbegin=0;if(typeOf(beginDate)=="number")lbegin=beginDate;else lbegin=beginDate.getTime();var lend=0;if(typeOf(end)=="number")lend=end;else lend=end.getTime();return lbegin<ltime&&ltime<lend;};Date.prototype.getWeekOfYear=function(){return new Date().get('week');};Array.prototype.any=function(min,imax){var len=this.length;var m=0;for(var i=0;i<len;i++){var fBox=$(this[i]);if(!fBox)continue;if('checkbox'==fBox.getProperty('type').toLowerCase()&&fBox.getProperty("checked"))m++;else if('radio'==fBox.getProperty('type').toLowerCase()&&fBox.getProperty("checked"))m++;else if('text'==fBox.getProperty('type').toLowerCase()&&fBox.get('value')!='')m++;}
if(imax==undefined)return min<=m;return min<=m&&m<=imax;};Array.prototype.sum=function(){var a=this;if((a instanceof Array)||(a&&typeOf(a)=="object"&&"length"in a)){var total=0;for(var i=0;i<a.length;i++){var element=a[i];if(!element)continue;if(typeOf(element)=="number")total+=element;else throw new Error("sum(): all array elements must be numbers");}
return total;}
else throw new Error("sum(): argument must be an array");};Array.prototype.max=function(){var m=Number.NEGATIVE_INFINITY;for(var i=0;i<this.length;i++)
if(this[i]>m)m=this[i];return m;};Array.prototype.min=function(){var m=Number.MAX_VALUE;for(var i=0;i<this.length;i++)
if(this[i]<m)m=this[i];return m;};Array.prototype.avg=function(){var a=this;if((a instanceof Array)||(a&&typeOf(a)=="object"&&"length"in a)){var m=0;for(var i=0;i<a.length;i++)
m=a[i]+m;return m/a.length;}
else throw new Error("avg(): argument must be an array");};Array.prototype.options=function(sel){return this.options(sel,":");};Array.prototype.options=function(sel,keyf){if(keyf==null||keyf==undefined)keyf=":";var out="";for(var i=0;i<this.length;i++){if(this[i]=="")continue;var hav=this[i].indexOf(keyf);if(hav==-1){out=out+"<option value=\""+this[i]+"\"";if(this[i]==sel)out=out+' selected="selected"';out=out+">"+this[i]+"</option>";}else{var keys=this[i].substring(0,hav);var vars=this[i].substring(hav+1,this[i].getLength());out=out+"<option value=\""+keys+"\"";if(keys==sel)out=out+' selected="selected"';out=out+">"+vars+"</option>";}}
return out;};Array.prototype.show=function(sel){if(typeOf(sel)=='number')sel=sel+'';for(var i=0;i<this.length;i++){if(this[i]=="")continue;var hav=this[i].indexOf(":");if(hav!=-1){var keys=this[i].substring(0,hav);if(keys==sel)
return this[i].substring(hav+1,this[i].getLength());}else if(this[i]==sel)return sel;}
return'';};Array.prototype.radio=function(rname,sel){return this.radio(rname,sel,null,":");};Array.prototype.radio=function(rname,sel,style,keyf){if(keyf==null||keyf==undefined)keyf=":";var out="";for(var i=0;i<this.length;i++){if(this[i]=="")continue;var hav=this[i].indexOf(keyf);if(hav==-1){out=out+'<label class="radioLabel">';out=out+' <input id="'+rname+i+'" name="'+rname+'" type="radio" value="'+this[i]+'"';if(this[i]==sel)out=out+' checked="checked"';if(style&&style!="")out=out+' style="'+style+'" ';out=out+' />'+this[i]+'</label>';}else{var keys=this[i].substring(0,hav);var vars=this[i].substring(hav+1,this[i].getLength());out=out+'<label class="radioLabel">';out=out+'<input id="'+rname+i+'" name="'+rname+'" type="radio" value="'+keys+'" ';if(keys==sel)out=out+'checked="checked" ';if(style&&style!="")out=out+'style="'+style+'" ';out=out+' />'+vars+'</label>';}}
return out;};Array.prototype.checkbox=function(rname,sel){return this.checkbox(rname,sel,null,":");};Array.prototype.checkbox=function(rname,selected,style,keyf){if(keyf==null||keyf==undefined)keyf=":";var sel;if(typeOf(selected)=="string")
sel=selected.split(";");else sel=selected;var out="";for(var i=0;i<this.length;i++){if(this[i]=="")continue;var hav=this[i].indexOf(keyf);if(hav==-1){out=out+'<label class="radioLabel">';out=out+' <input id="'+rname+i+'" name="'+rname+'" type="checkbox" value="'+this[i]+'" ';if(sel&&sel.contains(this[i]))out=out+'checked="checked" ';if(style&&style!="")out=out+'style="'+style+'" ';out=out+' />'+this[i]+'</label>';}else{var keys=this[i].substring(0,hav);var vars=this[i].substring(hav+1,this[i].getLength());out=out+'<label class="radioLabel">';out=out+'<input id="'+rname+i+'" name="'+rname+'" type="checkbox" value="'+keys+'"';if(sel&&sel.contains(keys))out=out+' checked="checked" ';if(style&&style!="")out=out+'style="'+style+'" ';out=out+' />'+vars+'</label>';}}
return out;};Array.prototype.toQueryString=function(name){var paramStr='';for(var i=0;i<this.length;i++){paramStr=paramStr+name+'='+this[i];if(this.length-1!=i)paramStr=paramStr+'&';}
return paramStr;};Array.prototype.toString=function(split){if(this.length<=0)return'';var paramStr='';for(var i=0;i<this.length;i++){paramStr=paramStr+this[i];if(this.length-1!=i)paramStr=paramStr+split;}
return paramStr;};function max(){var m=Number.NEGATIVE_INFINITY;for(var i=0;i<arguments.length;i++)
if(arguments[i]>m)m=arguments[i];return m;}
function min(){var m=Number.MAX_VALUE;for(var i=0;i<arguments.length;i++)
if(arguments[i]<m)m=arguments[i];return m;}
function sum(){var m=0;for(var i=0;i<arguments.length;i++)
m=arguments[i]+m;return m;}
function avg(){var m=0;for(var i=0;i<arguments.length;i++)
m=arguments[i]+m;return m/arguments.length;}
function $g(){var Url=top.window.location.href;var u,vname;if(arguments[0]=="#"){u=Url.split("#");if(arguments[1]=='*')return u[1];var bq="";if(u[1]&&u[1].indexOf('_')!=-1)bq=u[1].split("_");if(typeOf(arguments[1])=='number'&&bq.length>=arguments[1])return bq[arguments[1]];vname=arguments[1]+"=";}
else{u=Url.split("?");vname=arguments[0]+"=";}
if(u.length<=1)g='';else g=u[1];if(g!=''){gg=g.split("&");for(i=0;i<gg.length;i++){var indexof=gg[i].indexOf(vname);if(indexof==0){return gg[i].substring(vname.length,gg[i].length);}}}
return'';}
var iframeHeightBind=function(){var iframe=false;if(typeOf(this)=='string')iframe=document.getElementById(this);else iframe=this;var bugFix=new Element('div',{'styles':{'clear':'both'}});var height=0;if(Browser.ie&&iframe.Document&&iframe.Document.body&&iframe.Document.body.scrollHeight)
{height=iframe.Document.body.scrollHeight;}else{var innerDoc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document;if(innerDoc&&innerDoc.body){if(!innerDoc.body.offsetHeight&&innerDoc.body.adopt)innerDoc.body.adopt(bugFix);height=innerDoc.body.offsetHeight;}}
height=height+16;if(Browser.ie6)height=height+42;if(Browser.ie7)height=height+20;if(height<40)height=window.screen.availHeight;iframe.height=height;};window.document.mousePos=function(event){var event=event||window.event;if(!event)return{x:window.screen.availWidth/2.5,y:window.screen.availHeight/4};return{x:event.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:event.clientY+document.body.scrollTop+document.documentElement.scrollTop};};window.document.getEvent=function(){if(document.all)return window.event;func=window.document.getEvent.caller;while(func!=null){var arg0=func.arguments[0];if(arg0)
if((arg0.constructor==Event||arg0.constructor==MouseEvent)||(typeof(arg0)=="object"&&arg0.preventDefault&&arg0.stopPropagation))
return arg0;func=func.caller;}
return window.event;};window.document.centerPosition=function(divSide,iwin){if(!divSide||typeOf(divSide)!='element')return;if(!iwin)iwin=1;var doc=divSide.getParentDocument();var scrollTop=doc.scrollTop;if(scrollTop==0){scrollTop=document.documentElement.scrollTop?document.documentElement.scrollTop:window.pageYOffset;}
if(!scrollTop)scrollTop=0;var left=doc.offsetWidth-divSide.offsetWidth;var top=scrollTop+(doc.clientHeight-divSide.offsetHeight)/3;var le=left/2-40;divSide.setStyle('left',le<0?left:le);divSide.setStyle('top',top+iwin);};window.document.getPosition=function(){var doc=document.documentElement;if(doc&&doc.clientHeight){return{x:(doc.clientWidth>doc.scrollWidth)?doc.clientWidth-1:doc.scrollWidth,y:(doc.clientHeight>doc.scrollHeight)?doc.clientHeight:doc.scrollHeight};}
else{return{x:(window.innerWidth>doc.scrollWidth)?window.innerWidth:doc.scrollWidth,y:(window.innerHeight>doc.scrollHeight)?window.innerHeight:doc.scrollHeight};}};Element.implement({index:function(){var sib=this.getParent().getChildren();for(var i=0;i<sib.length;i++){if(sib[i]==this){sib=null;return i;}}},centerPosition:function(iWin){window.document.centerPosition(this,iWin);},deleteOptions:function(){if(this.tagName.toLowerCase()=="select"){var selLen=this.options.length;var i=0;if(Browser.ie)
for(i=0;i<selLen;i++)
this.options.remove(0);else
for(i=0;i<selLen;i++)
this.remove(0);this.options.length=0;}else alert(this.id+"错误的输入框类型");},setOptions:function(array,sel,keyf){if(typeOf(array)=='array')
array.setOptions(this,sel,keyf);else
array.split(";").setOptions(this,sel,keyf);},sendBind:function(bindId){this.set('send',{onComplete:function(response){var tagName=$(bindId).get('tag');if("input"==tagName.toLowerCase()||"textarea"==tagName.toLowerCase())
$(bindId).set('value',response);else if("div"==tagName.toLowerCase()||"span"==tagName.toLowerCase())
$(bindId).set('html',response);else if("select"==tagName.toLowerCase())
$(bindId).setOptions(response.toArray());}});this.send();},setSelected:function(v){var selLen=this.options.length;for(var i=0;i<selLen;i++){if(this.options[i].value==v){this.selectedIndex=i;return;}}},getParentDocument:function(){var doc=false;var useEl=document.documentElement?true:false;if(self.frameElement&&self.frameElement.tagName=="IFRAME"){if(useEl)doc=window.parent.document.documentElement;else doc=window.parent.document.body;return doc;}else{if(useEl)doc=window.document.documentElement;else doc=window.document.body;return doc;}},getWidth:function(){var width=this.getStyle('width');if('NaN'==width||'auto'==width){if(Browser.chrome)
width=document.defaultView.getComputedStyle(this,null)['width'];if(navigator.userAgent.toLowerCase().indexOf('trident')!=-1)
width=this.currentStyle['width'];if('NaN'==width||'auto'==width)
width=this.offsetWidth;}
if(typeOf(width)=='string')
width=width.toInt();return width;}});function getRadioValue(name){var radios=false;if(typeOf(name)=='string')radios=$$(name);else radios=name;for(var r=0;r<radios.length;r++){if(radios[r].getProperty("checked")){return radios[r].get('value');}}
return null;}
function getCheckboxValue(name){var radios=false;if(typeOf(name)=='string')radios=$$(name);else radios=name;var sel=[];radios.each(function(item){if(item.checked==true){sel.push(item.get('value'));}});return sel;}
function $clear(timer){clearTimeout(timer);clearInterval(timer);return null;}
String.prototype.compareColor=function(color){if(this==color)return true;if(this==null||color==null)return false;if(this.toLowerCase().replace(/ /g,'')==color.toLowerCase().replace(/ /g,''))return true;var tempColor=false;if(this.toLowerCase().indexOf("rgb")==-1&&this.length>1){tempColor=this.hexToRgb();if(!tempColor)return false;tempColor=tempColor.toLowerCase().replace(/ /g,'');return(tempColor==color.toString().toLowerCase().replace(/ /g,""));}
if(color.toLowerCase().indexOf("rgb")==-1&&color.length>1){tempColor=color.hexToRgb();if(!tempColor)return false;tempColor=tempColor.toLowerCase().replace(/ /g,'');return(tempColor==this.toString().toLowerCase().replace(/ /g,""));}};function swapTableCell(mytable,startCell,endCell){if(startCell==endCell)return;var oTBody=mytable.tBodies[0];for(var i=0;i<=oTBody.rows.length;i++){swapNode(mytable.rows.item(i).cells[startCell],mytable.rows.item(i).cells[endCell]);}}
function swapNode(node1,node2){var parent=node1.parentNode;var t1=node1.nextSibling;var t2=node2.nextSibling;if(t1)parent.insertBefore(node2,t1);else parent.appendChild(node2);if(t2)parent.insertBefore(node1,t2);else parent.appendChild(node1);}
function createInputElement(vinput,svalue){if(svalue==null||svalue=='&nbsp;')svalue='';var myAnchor=false;if(!vinput.input)alert('type .input no definition,表格头部没有定义');if(vinput.input=="button"||vinput.input=="cbutton"){if(vinput.input=="cbutton"&&(svalue==''||svalue=='0'))
{myAnchor=new Element('div',{html:'&nbsp;'});}
else if(vinput.blink){myAnchor=new Element('a',{'class':'button',href:vinput.blink});if(vinput.caption&&vinput.caption.indexOf('|')!=-1)
myAnchor.adopt(new Element('span',{html:vinput.caption.substring(vinput.caption.indexOf('|')+1,vinput.caption.length)}));else myAnchor.adopt(new Element('span',{html:vinput.caption}));}}else
if("textarea"==vinput.input){myAnchor=new Element('textarea',{rows:1,name:vinput.name,value:svalue});}else
if("select"==vinput.input){myAnchor=new Element('select',{name:vinput.inputName?vinput.inputName:vinput.name});myAnchor.setOptions(vinput.option,svalue);}else
if("selectView"==vinput.input){myAnchor=new Element('select',{name:vinput.inputName?vinput.inputName:vinput.name});myAnchor.setOptions(svalue,vinput.option);}
else
if("urlDialog"==vinput.input){myAnchor=new Element('input',{type:'text',name:vinput.inputName?vinput.inputName:vinput.name,'class':'colorBox',value:svalue});}else
if("selectbox"==vinput.input.toLocaleLowerCase()){myAnchor=new Element('input',{type:'checkbox',name:vinput.inputName?vinput.inputName:vinput.name,value:svalue});}else
if("checkbox"==vinput.input){myAnchor=new Element('input',{type:vinput.input,name:vinput.inputName?vinput.inputName:vinput.name,value:svalue});if(this.options){var selectArray=vinput.options;if(typeOf(this.options)=='string')
selectArray=vinput.options.split(";");if(typeOf(selectArray)=='array'&&selectArray.contains(svalue))
myAnchor.set('checked','checked');}}else
if("color"==vinput.input){myAnchor=new Element('input',{type:'text',name:vinput.inputName?vinput.inputName:vinput.name,'class':'colorBox',value:svalue});}else
if("date"==vinput.input){myAnchor=new Element('input',{type:'text','class':'calendar',name:vinput.inputName?vinput.inputName:vinput.name,value:svalue});}else
if("text"==vinput.input){myAnchor=new Element('input',{type:vinput.input,name:vinput.inputName?vinput.inputName:vinput.name,value:svalue});}else
if("img"==vinput.input){myAnchor=new Element('img',{type:vinput.input,name:vinput.inputName?vinput.inputName:vinput.name,src:svalue});}else
if("img_button"==vinput.input){myAnchor=new Element('a',{'href':vinput.blink});myAnchor.adopt(new Element('img',{type:vinput.input,name:vinput.inputName?vinput.inputName:vinput.name,src:vinput.image}));}else
{myAnchor=new Element('div',{html:'&nbsp;'});}
return myAnchor;}
function getTableCellValue(tableCell,fixed){var tempEl=tableCell.getElement("input");if(tempEl)return tempEl.get("value");var result='';tempEl=tableCell.getElement("textarea");if(tempEl)
{result=tempEl.get("value");if(fixed&&result)
return result.replace(/\</g,"&lt;").replace(/\>/g,"&gt;");else return result;}
tempEl=tableCell.getElement("select");if(!tempEl)tempEl=tableCell.getElement("checkbox");if(tempEl)return tempEl.get("value");return tableCell.get('html');}
function getTableCellChecked(tableCell){var fnp=tableCell.innerHTML;if(Browser.name=='ie'){var tempEl=new Element('div',{'html':fnp});if(tempEl.getElement("input"))
return tempEl.getElement("input").get("checked");}else{if(tableCell.getElement("input"))
return tableCell.getElement("input").get("checked");}
return false;}
function convert(sValue,sDataType){switch(sDataType){case"number":if(sValue==null)return 0;return sValue.trim().toNumber()||0;case"text":if(sValue==null)return 0;if(sValue.length>40)return sValue.cut(40);return sValue.trim()||"";case"color":if(sValue==null)return 0;var tempColor=sValue;if(sValue.toLowerCase().indexOf("rgb")==-1&&sValue.length>1)
tempColor=color.hexToRgb();return tempColor.replace('rgb','').replace(/ /g,'').replace(/, /g,'').trim().toInt()||0;case"date":if(sValue==null)return 0;return sValue.toDate().getTime()||0;default:if(sValue==null)return"";return sValue()||"";}}
var ColorBox=new Class({Implements:Options,options:{ptag:'body',colorBoxCss:'.colorBox',option:'default',images:'/share/icon/color.png'},initialize:function(options){this.setOptions(options);if(!this.ptag)this.ptag="body";},cssInit:function(){if(!this.options.option||this.options.option=="default")this.options.option="#000000;#B0B0B0;#F0F0F0;#FFFFFF;#F00000;#FFE0E0;#00cc00;#0FF0C0;#00ccFF;#bbF000;#0000BB;#B111B1;#BBBB00;#FFFF00;#FFBB00;#FF00FF";var cr=this;var colorBoxCss=cr.options.colorBoxCss;$$(cr.ptag.toLowerCase()+" "+colorBoxCss).each(function(cbox){if(cbox.get('colorInit'))return;cbox.set('colorInit',true);var imgBox=new Element('img',{'src':cr.options.images,'class':'jSelectButton'});imgBox.inject(cbox,'after');if(cbox.hasClass('max'))
{imgBox.addEvent('click',function(event){var dialog=new JDialog.Color({'title':'颜色对话框 Color','callback':function(_confirmed){cbox.set('value',_confirmed);cbox.setStyle("background-color",cbox.value);cbox.focus();}});dialog.show();});}else imgBox.addEvent('click',function(event){event.stop();var colorPaneId=cbox.id+'_colorPanel';var colorPane=$(colorPaneId);if(colorPane)return false;var position=cbox.getPosition();var positionX=position.x;var pDiv=cbox.getParent();if(pDiv)positionX=position.x+pDiv.scrollLeft;colorPane=new Element('div',{id:colorPaneId,'class':'colorPanel',styles:{position:"absolute",left:positionX+"px",top:(position.y+20)+"px"}});colorPane.adopt(new Element('span'));cbox.getParent().adopt(colorPane);var colArray=cr.options.option.split(";");for(var i=0;i<colArray.length;i++){var col=colArray[i];colorPane.adopt(new Element('div',{styles:{'background-color':col},events:{mouseover:function(event){var selColor=this.getStyle("background-color");colorPane.getElement("span").setStyle("background-color",selColor);},click:function(event){var selColor=colorPane.getElement("span").getStyle("background-color");cbox.set("value",selColor);cbox.setStyle("background-color",cbox.value);cbox.focus();colorPane.destroy();}}}));}
colorPane.addEvent('mouseleave',function(event){this.destroy();});colorPane.makeDraggable({onStart:function(){this.element.setStyle('opacity',0.5);},onComplete:function(){this.element.setStyle('opacity',1);}});});});}});var RangeInput=new Class({Implements:Options,options:{ptag:'body',rangeCss:'input.range',option:'default',backgroundColor:'#CAD8F3',lightColor:'#598BEC',images:'/share/icon/color.png'},initialize:function(options){this.setOptions(options);var ri=this;var inputArray=$$(this.options.rangeCss);if(inputArray)
{inputArray.addEvent('keyup',function(){if(!this.get('value').isNumber()){var v=this.get('value');if(v=='')this.set('value',this.get('defaultValue'));else{var showV='';for(var i=0;i<v.length;i++){var sv=v.charAt(i)+"";if(sv.isInteger())
showV=showV+sv;}
if(showV=='')this.set('value',this.get('defaultValue'));else this.set('value',showV);}}
var value=this.get('value');var min=this.get('min');var max=this.get('max');if(min&&max)
this.set('value',value.toInt().limit(min.toInt(),max.toInt()));});inputArray.each(function(e){e.setStyles({'float':'left','width':'50px'});var v=e.get('value').toInt();var sliderWidth=e.get('sliderWidth');if(!sliderWidth&&e.getStyle('width').toInt()>50)sliderWidth=e.getStyle('width').toInt()-50;else sliderWidth=100;var sliderEl=new Element('div',{styles:{'float':'left','margin':0,padding:0,'height':'21px','width':sliderWidth+'px','border-bottom':'1px solid #BBB'}});var blackEl=new Element('div',{'align':'center',styles:{'cursor':'pointer','margin':0,'padding':0,'height':'21px','vertical-align':'top',width:'16px','background-color':ri.options.backgroundColor}});blackEl.addEvent('mouseover',function(){this.setStyle('background-color',ri.options.lightColor);});blackEl.addEvent('mouseleave',function(){this.setStyle('background-color',ri.options.backgroundColor);});sliderEl.adopt(blackEl);sliderEl.inject(e,'after');if(Browser.name=='chrome')sliderEl.setStyle('margin-top',3);var steps=e.get('max');if(steps==null||!steps)steps=10000;else steps=steps.toInt();new Slider(sliderEl,blackEl,{steps:steps,Offset:v,wheel:true,onChange:function(){var value=this.step;var min=e.get('min');if(min==null||!min)min=0;else min=min.toInt();var max=e.get('max');if(max==null||!max)max=10000;else max=max.toInt();e.set('value',value.toInt().limit(min,max));}}).set(v);});}}});var Calendar=new Class({Implements:[Options,Events],options:{ptag:'body',calendarCss:'.calendar',language:0,format:"yyyy-MM-dd",images:'/share/icon/calendar.png',curDayClass:'calendarCurrentDay',tipDayClass:'calendarTipDay',oldTipDayClass:'calendarOldTipDay',lang:{weeks:[["星期一","星期二","星期三","星期四","星期五","星期六","星期天"],["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]],weeksMenu:[["一","二","三","四","五","六","日"],["MON","TUR","WED","THU","FRI","SAT","SUN"]]}},initialize:function(options){this.setOptions(options);if(!this.ptag)this.ptag="body";this.language=this.options.language;this.lang=this.options.lang;this.images=this.options.images;this.calendarCss=this.options.calendarCss;this.tipDayClass=this.options.tipDayClass;this.oldTipDayClass=this.options.oldTipDayClass;this.Date=new Date();this.Year=this.Date.getFullYear();this.Month=this.Date.getMonth();this.Week=this.Date.getDay();this.Today=this.Date.getDate();if(this.language=='zh')this.language=0;this.format=this.options.format||"yyyy-MM-dd";this.msgStore=this.options.msgStore||[];},getViewElement:function()
{this.caleContainer=new Element('div',{'class':'calendarContainer'});var caleElem='<div class="calendarTopContainer"><table cellpadding="0" cellspacing="0"><tr>';caleElem+='<td class="calendarTodayView"></td>';caleElem+='<td>';caleElem+='<table class="calendarYearMonthContainer" cellpadding="0" cellspacing="0">';caleElem+='<tr>';caleElem+='<td>';caleElem+='<a class="linkQuickYear" style="cursor:pointer;"></a>';caleElem+='<input type="text" class="selectQuickYear" />';caleElem+='</td>';caleElem+='<td>.</td>';caleElem+='<td>';caleElem+='<a class="linkQuickMonth" style="cursor:pointer;"></a>';caleElem+='<input type="text" class="selectQuickMonth" />';caleElem+='</td>';caleElem+='</tr>';caleElem+='</table>';caleElem+='<div class="calendarWeekView"></div>';caleElem+='</td>';caleElem+='<td>';caleElem+='<div class="calendarCloseContainer">';caleElem+='<a class="calendarClose" style="cursor:pointer;">x</a>';caleElem+='</div>';caleElem+='<div class="calendarQuickContainer">';caleElem+='<a class="toPrevYear" style="cursor:pointer;">◄</a>';caleElem+='<a class="toPrevMonth" style="cursor:pointer;">←</a>';caleElem+='<a class="backToday" style="cursor:pointer;">▇</a>';caleElem+='<a class="toNextMonth" style="cursor:pointer;">→</a>';caleElem+='<a class="toNextYear" style="cursor:pointer;">►</a>';caleElem+='</div>';caleElem+='</td>';caleElem+='</tr></table></div>';caleElem+='<div class="calendarMainContainer">';caleElem+='<div class="calendarWeeksContainer">';for(var i=0;i<7;i++){caleElem+='<span>'+this.lang["weeksMenu"][this.language][i]+'</span>';}
caleElem+='</div>';caleElem+='<table class="calendarDaysContainer" cellpadding="0" cellspacing="0">';for(var tr=0;tr<6;tr++){caleElem+='<tr>';for(var td=0;td<7;td++){caleElem+='<td><span></span></td>';}
caleElem+='</tr>';}
caleElem+='</table>';caleElem+='<div class="calendarYearContainer" ></div>';caleElem+='<div class="calendarMonthContainer" ></div>';caleElem+='</div>';caleElem+='<div class="calendarTipsContainer" ></div>';this.caleContainer.set('html',caleElem);this.yearContainer=this.caleContainer.getElement('div.calendarYearContainer');this.monthContainer=this.caleContainer.getElement('div.calendarMonthContainer');this.msgContainer=this.caleContainer.getElement('div.calendarTipsContainer');this.lq_year=this.caleContainer.getElement('a.linkQuickYear');this.sq_year=this.caleContainer.getElement('input.selectQuickYear');this.lq_month=this.caleContainer.getElement('a.linkQuickMonth');this.sq_month=this.caleContainer.getElement('input.selectQuickMonth');this.today_view=this.caleContainer.getElement('td.calendarTodayView');this.week_view=this.caleContainer.getElement('div.calendarWeekView');this.prev_Year=this.caleContainer.getElement('a.toPrevYear');this.prev_month=this.caleContainer.getElement('a.toPrevMonth');this.back_today=this.caleContainer.getElement('a.backToday');this.next_month=this.caleContainer.getElement('a.toNextMonth');this.next_Year=this.caleContainer.getElement('a.toNextYear');this.calendarWeeksContainer=this.caleContainer.getElement('div.calendarWeeksContainer');this.calendarDaysContainer=this.caleContainer.getElement('table.calendarDaysContainer');this.calendarClose=this.caleContainer.getElement('a.calendarClose');return this.caleContainer;},getMonthViewArray:function(year,month){var monthArray=[],beginDayOfWeek=new Date(year,month,0).getDay(),daysOfMonth=new Date(year,month+1,0).getDate();for(var i=0;i<42;i++)
monthArray[i]="&nbsp;";for(var j=0;j<daysOfMonth;j++)
monthArray[j+beginDayOfWeek]=j+1;return monthArray;},bindAllData:function(curYear,curMonth){this.lq_year.set('value',curYear);this.sq_year.set('value',curYear);this.changeSelectValue(curYear,curMonth);this.today_view.innerHTML=this.Today;this.week_view.innerHTML=this.lang['weeks'][this.language][this.Week];var daysOfMonthArray=this.getMonthViewArray(curYear,curMonth),spans=this.calendarDaysContainer.getElements("span"),curYMD=this.Year+""+(this.Month+1)+""+this.Today,selectYear=this.sq_year.value,selectMonth=this.sq_month.value;for(var i=0;i<spans.length;i++)
{spans[i].innerHTML=daysOfMonthArray[i];var selectYMD=selectYear+""+selectMonth+""+spans[i].innerHTML;if(curYMD==selectYMD)
spans[i].className=this.options.curDayClass;else
spans[i].className="";}
if(this.msgStore!="")this.initPopMsg(this.msgStore);},bindAllEvent:function(){var cr=this;this.prev_Year.onclick=function(){cr.resetLinkSelect();cr.goPrevOrNextYear(this);};this.next_Year.onclick=function(){cr.resetLinkSelect();cr.goPrevOrNextYear(this);};this.prev_month.onclick=function(){cr.resetLinkSelect();cr.goPrevOrNextMonth(this);};this.next_month.onclick=function(){cr.resetLinkSelect();cr.goPrevOrNextMonth(this);};this.back_today.onclick=function(){cr.resetLinkSelect();cr.bindAllData(cr.Year,cr.Month);};this.today_view.onclick=function(){cr.resetLinkSelect();cr.bindAllData(cr.Year,cr.Month);};this.sq_year.onchange=function(){cr.bindAllData(cr.sq_year.value,cr.sq_month.value.toInt()-1);};this.sq_month.onchange=function(){cr.bindAllData(cr.sq_year.value,cr.sq_month.value.toInt()-1);};this.sq_year.onkeyup=function(event)
{if(event.key=='enter')
{cr.resetLinkSelect();}};this.sq_month.onkeyup=function(event)
{if(event.key=='enter')
{cr.resetLinkSelect();}};this.lq_year.onclick=function(){if(this.getStyle('display')=='none')return;this.setStyle('display','none');cr.sq_year.setStyle('display','');cr.calendarWeeksContainer.setStyle('display','none');cr.calendarDaysContainer.setStyle('display','none');cr.monthContainer.setStyle('display','none');cr.yearContainer.setStyle('display','');var curYear=cr.lq_year.get('value').toInt();var selectYear='';for(var i=curYear-15;i<curYear+10;i++)
{if(i==cr.Year)selectYear=selectYear+"<a class='"+cr.options.curDayClass+"'>"+i+"</a>";else selectYear=selectYear+"<a>"+i+"</a>";}
var leftYear=new Element('a',{html:'◁','startYear':(curYear-25)});var rightYear=new Element('a',{html:'▷','startYear':(curYear+10)});var closeYear=new Element('a',{html:'×'});closeYear.addEvent('click',function(){cr.resetLinkSelect();});cr.yearContainer.set('html',selectYear);var liArray=cr.yearContainer.getElements('a');liArray.addEvent('click',function(){cr.bindAllData(this.get('html').toInt(),cr.sq_month.get('value').toInt());cr.yearContainer.setStyle('display','none');cr.calendarWeeksContainer.setStyle('display','block');cr.calendarDaysContainer.setStyle('display','block');});leftYear.addEvent('click',function(){var startYear=this.get('startYear').toInt();var selectYear='';for(var i=startYear;i<startYear+25;i++)
{if(i==cr.Year)selectYear=selectYear+"<a class='"+cr.options.curDayClass+"'>"+i+"</a>";else selectYear=selectYear+"<a>"+i+"</a>";}
cr.yearContainer.set('html',selectYear);var liArray=cr.yearContainer.getElements('a');liArray.addEvent('click',function(){var month=cr.sq_month.get('value').toInt();cr.bindAllData(this.get('html').toInt(),month);cr.resetLinkSelect();});leftYear.set('startYear',(startYear-25));rightYear.set('startYear',(startYear+25));cr.yearContainer.adopt(leftYear);cr.yearContainer.adopt(rightYear);cr.yearContainer.adopt(closeYear);});rightYear.addEvent('click',function(){var startYear=this.get('startYear').toInt();var selectYear='';for(var i=startYear;i<startYear+25;i++)
{if(i==cr.Year)selectYear=selectYear+"<a class='"+cr.options.curDayClass+"'>"+i+"</a>";else selectYear=selectYear+"<a>"+i+"</a>";}
cr.yearContainer.set('html',selectYear);var liArray=cr.yearContainer.getElements('a');liArray.addEvent('click',function(){var month=cr.lq_month.get('html').toInt();cr.bindAllData(this.get('html').toInt(),month);cr.resetLinkSelect();});leftYear.set('startYear',(startYear-25));rightYear.set('startYear',(startYear+25));cr.yearContainer.adopt(leftYear);cr.yearContainer.adopt(rightYear);cr.yearContainer.adopt(closeYear);});cr.yearContainer.adopt(leftYear);cr.yearContainer.adopt(rightYear);cr.yearContainer.adopt(closeYear);cr.sq_year.focus();};this.lq_month.onclick=function(){cr.lq_month.setStyle('display','none');cr.sq_month.setStyle('display','');cr.sq_month.focus();cr.calendarWeeksContainer.setStyle('display','none');cr.calendarDaysContainer.setStyle('display','none');cr.yearContainer.setStyle('display','none');cr.monthContainer.setStyle('display','');var selectMonth="";for(var i=1;i<13;i++)
{if(i-1==cr.Month)selectMonth=selectMonth+"<a class='"+cr.options.curDayClass+"'>"+i+"</a>";else selectMonth=selectMonth+"<a>"+i+"</a>";}
cr.monthContainer.set('html',selectMonth);var liArray=cr.monthContainer.getElements('a');liArray.addEvent('click',function(){cr.bindAllData(cr.sq_year.get('value').toInt(),(this.get('html').toInt()-1));cr.resetLinkSelect();});};var spans=this.calendarDaysContainer.getElements("span");for(var i=0;i<spans.length;i++){spans[i].onmouseover=function(){if(this.innerHTML!="&nbsp;"&&this.className=="")
this.style.backgroundColor="#f1f1f1";};spans[i].onmouseout=function(){if(this.innerHTML!="&nbsp;")
this.style.backgroundColor="";};}},changeSelectValue:function(year,month){this.lq_year.set('html',year);month=month+1;this.lq_month.set('html',month);this.sq_month.set('value',month);this.resetLinkSelect();},resetLinkSelect:function(){this.sq_year.setStyle('display','none');this.sq_month.setStyle('display','none');this.yearContainer.setStyle('display','none');this.calendarWeeksContainer.setStyle('display','block');this.calendarDaysContainer.setStyle('display','block');this.monthContainer.setStyle('display','none');this.lq_year.setStyle('display','block');this.lq_month.setStyle('display','block');},goPrevOrNextMonth:function(obj){var curMonthSelect=this.sq_month;var curMonth=parseInt(curMonthSelect.value);var curYear=parseInt(this.sq_year.value);if(obj==this.next_month)
curMonthSelect.value=curMonth+1;else
curMonthSelect.value=curMonth-1;var getNowMonth=curMonthSelect.value-1;if(getNowMonth<0)getNowMonth=0;if(getNowMonth>11)getNowMonth=11;this.bindAllData(curYear,getNowMonth);},goPrevOrNextYear:function(obj){var year=this.lq_year.get('html').toInt();var month=this.lq_month.get('html').toInt();if(obj==this.next_Year)year=year+1;else year=year-1;if(year<1800)year=1800;this.bindAllData(year,month-1);},initPopMsg:function(){var cr=this;var selectYear=this.sq_year.value;var selectm=this.sq_month.value;var spans=this.calendarDaysContainer.getElements("span");for(var key in this.msgStore){var keyY=key.substring(0,4);var keyMD=key.substring(4);for(var i=0;i<spans.length;i++){var d=spans[i].innerHTML;if(selectm.length<2)selectm="0"+selectm;if(d.length<2)d="0"+d;var getMD=selectm+""+d;if(getMD==keyMD){if(selectYear==keyY)
spans[i].className=this.tipDayClass+" "+keyY;else
spans[i].className=this.oldTipDayClass+" "+keyY;spans[i].onmouseover=function()
{var hoverDate=this.className.split(" ")[1]+""+selectm+""+this.innerHTML;var y=this.className.split(" ")[1];var d=this.innerHTML;if(y)
{cr.msgContainer.innerHTML=cr.getMsgHtml(y,selectm,d);cr.msgContainer.setStyle('display','block');}};}}}},getMsgHtml:function(y,m,d){if(m.length<2)m="0"+m;if(d.length<2)d="0"+d;var date=y+m+d;var showDate=y+"-"+m+"-"+d;return'<div>'+showDate+':</div><div>'+this.msgStore[date]+'</div>';},bindInput:function(popEl,inputId,hide)
{var cr=this;var cbox=false;if(typeOf(inputId).toLowerCase()=='string')cbox=$(inputId);else cbox=inputId;if(cbox)
{var format=cbox.get('format')||cr.format||'yyyy-MM-dd';var spans=popEl.getElements(".calendarDaysContainer span");spans.addEvent('click',function(){var da=this.get('html');if(da!="&nbsp;")
{var year=popEl.getElement('.selectQuickYear').get('value');var month=popEl.getElement('.selectQuickMonth').get('value');var dateStr=year+"-"+month+"-"+da+" "+new Date().getHours()+":"+new Date().getMinutes();dateStr=dateStr.toDate().string(format);cbox.set('value',dateStr);if(hide&&popEl)
popEl.dispose();}});}},tip:function(instanceId,msgId,msgData,inputId){this.popContainer=$(instanceId);var msgBox=$(msgId);if(msgBox)this.msgContainer=msgBox;if(this.popContainer)
{var cr=this;this.popContainer.adopt(this.getViewElement());this.bindAllEvent();this.bindAllData(this.Year,this.Month);this.calendarClose.setStyle('display','none');if(typeOf(msgData)=='object'){this.msgStore=msgData;this.initPopMsg(this.msgStore);cr.caleContainer.addEvent('mouseleave',function(){(function(){this.style.display="none";}).delay(2000,cr.msgContainer);});}
if(inputId)this.bindInput(this.popContainer,inputId,false);}},show:function(panelDiv,inputId){var cbox=$(inputId);if(!cbox)return;if(cbox.get('format'))
this.format=cbox.get('format');if(typeOf(panelDiv)!='element')
this.popContainer=$(panelDiv);else this.popContainer=panelDiv;this.popContainer.adopt(this.getViewElement());this.calendarClose.setStyle('display','none');this.bindAllEvent();this.bindAllData(this.Year,this.Month);this.bindInput(this.popContainer,inputId,false);if(cbox)cbox.focus();},cssInit:function(){var cr=this;$$(cr.ptag.toLowerCase()+" "+cr.calendarCss).each(function(cbox){if(cbox.getProperty('calendarInit'))return;cbox.setProperty('calendarInit',true);var imgBox=new Element('img',{'src':cr.images,'class':'jSelectButton'});imgBox.inject(cbox,'after');imgBox.addEvent('click',function(event){event.stop();if(cr.popContainer)cr.popContainer.dispose();cr.popContainer=new Element("div",{'class':'popContainer'});cr.popContainer.adopt(cr.getViewElement());document.body.appendChild(cr.popContainer);cr.bindAllEvent();cr.bindAllData(cr.Year,cr.Month);cr.bindInput(cr.popContainer,cbox,true);cr.format=cbox.getProperty('format');var position=cbox.getPosition();var positionX=position.x;var pDiv=cbox.getParent('div');if(pDiv)positionX=position.x+pDiv.scrollLeft;cr.popContainer.setStyles({position:"absolute",left:positionX+"px",top:position.y+20+"px",'z-index':120});cr.calendarClose.addEvent('click',function(){cr.popContainer.dispose();});cr.popContainer.makeDraggable({onStart:function(){this.element.setStyle('opacity',.5);},onComplete:function(){this.element.setStyle('opacity',1);}});cbox.focus();});});}});var JModalPanel=new Class({Implements:[Options,Events],options:{top:100,callback:null,closeCss:'closeModalPanel'},initialize:function(_opts){this.setOptions(_opts);this.times=Number.random(0,10000);this.windowId="windowSide_"+this.times;this.closeBtn=new Element('a',{'class':this.options.closeCss,'html':'×'});var sf=this;this.closeBtn.addEvent('click',function(event){sf.close();});this.contentDiv=new Element('div',{'align':'center',styles:{'margin-top':this.options.top}});this.blackgroundLock=new Element('div',{id:this.windowId,'class':'blackgroundLock'});this.blackgroundLock.adopt(this.closeBtn);this.blackgroundLock.adopt(this.contentDiv);this.blackgroundLock.setStyle('z-index',1);window.document.body.appendChild(this.blackgroundLock);},adopt:function(el)
{this.contentDiv.adopt(el);},close:function()
{this.blackgroundLock.destroy();window.currentStep=false;window.modalPanel=false;}});var JWindow=new Class({Implements:[Options,Events],options:{message:'Message not specified.',url:false,ajaxErrorMessage:'<h3>Error 404</h3><p>The requested file could not be found.</p>',ajaxDelay:800,topHeight:100,top:0,left:0,width:'auto',height:'auto',title:'title',modal:false,resize:true,move:true,scrollWin:true,minButton:true,zoomButton:true,maxButton:true,loadIcon:'/share/images/loading.gif',callback:null,winIconCss:'winIcon',windowCss:'a.window'},initialize:function(_opts){this.setOptions(_opts);this.times=Number.random(0,10000);this.windowSideId="windowSide_"+this.times;this.windowInsideId="windowInside_"+this.times;this.windowTitlePaneId="windowTitlePanel_"+this.times;this.windowContextId="windowContext_"+this.times;this.windowButtonPaneId="windowButtonPaneID_"+this.times;this.winIconId="winIconID_"+this.times;this.windowButtonPaneId="windowButtonPanel_"+this.times;this.minWindowId="minWindow_"+this.times;this.maxWindowId="maxWindow_"+this.times;this.zoomWindowId="zoomWindow_"+this.times;this.closeWindowsId="closeWindow_"+this.times;},getTimes:function()
{return this.times;},beginLoading:function(){var loading=new Element("img",{src:this.options.loadIcon,'class':'loading',border:'0'});var w=$(this.windowContextId);if(w&&w!=null)
{w.empty();w.appendChild(loading);}},hide:function(){this.fireEvent('beforeHide');$(this.windowSideId).setStyle('display','none');},show:function(){var win=this;var wincontHC=32;var fixedTop=0;if($(this.windowSideId)){this.fireEvent('beforeShow');$(this.windowSideId).setStyle('display','');return;}
function saveXYWH(){var windowState=windowSide.retrieve('windowState');if(windowState==0){windowSide.store('windowOldLeft',windowSide.getStyle('left'));windowSide.store('windowOldTop',windowSide.getStyle('top'));windowSide.store('windowOldWidth',windowSide.getStyle('width'));windowSide.store('windowOldHeight',windowSide.getStyle('height'));windowSide.store('windowOldInsideHeight',windowInside.retrieve('height'));windowSide.store('windowOldInsideWidth',windowInside.retrieve('width'));windowSide.store('windowOldContextHeight',win.windowContext.getStyle('height'));windowSide.store('windowOldContextWidth',win.windowContext.getStyle('width'));var iframeEl=win.windowContext.getElement('iframe');if(iframeEl)
{windowSide.store('iframeOldWidth',iframeEl.getStyle('width'));windowSide.store('iframeOldHeight',iframeEl.getStyle('height'));}}}
function getWindowHeight(){var height=windowSide.getStyle('height');if(height!='auto'&&height.indexOf('%')==-1)
return height.toInt();var position=dragSizePane.getElement('span').getPosition();return(position.y-windowSide.getStyle('top').toInt()+10);}
function getMaxZindex(){var wins=$$('.windowSide');if(!wins)return 200;var result=0;for(var i=0;i<wins.length;i++)result=max(result,wins[i].getStyle('z-index').toInt());if(result<200)result=200;return result;}
win.windowContext=new Element('div',{id:win.windowContextId,'class':'windowContext'});var windowSide=new Element('div',{id:win.windowSideId,'class':'windowSide'});if(this.options.pop)
{if(self.frameElement&&self.frameElement.getParentDocument&&self.frameElement.tagName=="IFRAME"){var pdoc=self.frameElement.getParentDocument();var bot=0;if(pdoc.offsetHeight==pdoc.clientHeight)bot=pdoc.scrollHeight-pdoc.clientHeight;else bot=pdoc.offsetHeight-pdoc.clientHeight;windowSide.setStyle("bottom",(bot-self.frameElement.getParentDocument().scrollTop-window.document.body.scrollTop));}else
windowSide.setStyle("bottom",0);windowSide.setStyle("position","fixed");windowSide.setStyle("float",'right');windowSide.setStyle("right",'1px');}
var windowInside=new Element('div',{id:this.windowInsideId,'class':'windowInside'});var windowTitlePane=new Element('div',{id:this.windowTitlePaneId,'class':'windowTitlePanel'});windowTitlePane.onmouseup=function(){fixedTop=windowSide.getStyle('top').toInt()-windowSide.getParentDocument().scrollTop.toInt();windowSide.setStyle('z-index',(getMaxZindex()+1));};if(this.options.zoomButton)
windowTitlePane.ondblclick=function(){var windowState=windowSide.retrieve('windowState');if(windowState==2)
$(win.zoomWindowId).fireEvent('click');else
if(windowState==0||windowState==1)
$(win.maxWindowId).fireEvent('click');};var zIndex=(getMaxZindex()+1);if(this.options.modal){this.blackgroundLock=new Element('div',{id:'blackgroundLock','class':'blackgroundLock'});this.blackgroundLock.setStyle('z-index',zIndex);window.document.body.appendChild(this.blackgroundLock);windowSide.setStyle('z-index',(zIndex+1));window.document.body.appendChild(windowSide);}else{windowSide.setStyle('z-index',zIndex);window.document.body.appendChild(windowSide);}
var windowButtonPane=new Element('div',{id:this.windowButtonPaneId,'class':'windowButtonPanel'});if(this.options.minButton)
windowButtonPane.adopt(new Element('span',{id:this.minWindowId,'class':'minWindow',events:{click:function(){var windowState=windowSide.retrieve('windowState');saveXYWH();win.windowContext.setStyle('display','none');windowSide.setStyle('width','120px');windowSide.setStyle('height','auto');windowInside.setStyle('width','110px');windowInside.setStyle('height','auto');this.setStyle('display','none');$(win.zoomWindowId).setStyle('display','');$(win.maxWindowId).setStyle('display','');windowSide.store('windowState',1);}}}),'bottom');if(this.options.zoomButton)
windowButtonPane.adopt(new Element('span',{id:this.zoomWindowId,'class':'zoomWindow',styles:{display:'none'},events:{click:function(){var windowState=windowSide.retrieve('windowState');windowSide.setStyle('left',windowSide.retrieve('windowOldLeft'));windowSide.setStyle('top',windowSide.retrieve('windowOldTop'));windowSide.setStyle('width',windowSide.retrieve('windowOldWidth'));windowSide.setStyle('height',windowSide.retrieve('windowOldHeight'));windowInside.setStyle('height',windowSide.retrieve('windowOldInsideHeight'));windowInside.setStyle('width',windowSide.retrieve('windowOldInsideWidth'));win.windowContext.setStyle('height',windowSide.retrieve('windowOldContextHeight'));win.windowContext.setStyle('width',windowSide.retrieve('windowOldContextWidth'));win.windowContext.setStyle('display','');this.setStyle('display','none');windowSide.store('windowState',0);if(win.options.minButton)
$(win.minWindowId).setStyle('display','');if(win.options.maxButton)
$(win.maxWindowId).setStyle('display','');var dlgContentPanel=win.windowContext.getElement("div.jdialogContentPanel");if(dlgContentPanel)
{dlgContentPanel.setStyle('height','auto');}
var iframeEl=win.windowContext.getElement('iframe');if(iframeEl)
{iframeEl.setStyle('height',windowSide.retrieve('iframeOldHeight'));iframeEl.setStyle('width',windowSide.retrieve('iframeOldWidth'));}}}}),'bottom');if(this.options.maxButton)
windowButtonPane.adopt(new Element('span',{id:this.maxWindowId,'class':'maxWindow',events:{click:function(){saveXYWH();var page=window.getSize();var maxW=page.x-2;var maxH=0;if(self.frameElement&&self.frameElement.getParentDocument&&self.frameElement.tagName=="IFRAME"){maxH=window.parent.document.body.getSize().y;-win.options.topHeight-wincontHC-30;}else maxH=page.y-wincontHC-40;windowSide.setStyles({'width':maxW,'height':maxH,'left':0});windowSide.store('windowState',2);windowInside.setStyles({'width':maxW-10,'height':maxH-22});this.setStyle('display','none');win.windowContext.setStyle('display','');if(win.options.minButton)$(win.minWindowId).setStyle('display','');if(win.options.zoomButton)$(win.zoomWindowId).setStyle('display','');win.windowContext.setStyle('width',windowInside.getStyle('width'));win.windowContext.setStyle('height',windowInside.getStyle('height'));var dlgContentPanel=win.windowContext.getElement("div.jdialogContentPanel");if(dlgContentPanel)dlgContentPanel.setStyle('height',maxH-wincontHC);var iframeEl=win.windowContext.getElement('iframe');if(iframeEl)
{iframeEl.setStyle('height',maxH-wincontHC);iframeEl.setStyle('width',maxW-10);}}}}),'bottom');var windowEvents=function(){if(!win.options.scrollWin||!windowSide||typeOf(windowSide)!='element')return;windowSide.setStyle('top',(windowSide.getParentDocument().scrollTop.toInt()+fixedTop));};windowButtonPane.adopt(new Element('span',{id:this.closeWindowsId,'class':'closeWindow',events:{click:function(){win.fireEvent('beforeClose',this);var closeMorph=false;if(win.scrollClose)
{var doc=window.document.body.getParentDocument();closeMorph={'top':doc.clientHeight,'background-color':'#FFFFF',color:'#FFFFF',"opacity":0.2};}else
closeMorph={'background-color':'#FFFFF',color:'#FFFFF',"opacity":0.2};var closeFx=new Fx.Morph(windowSide,{duration:500,onComplete:function(){if(typeof(win.blackgroundLock)!=undefined&&win.blackgroundLock)win.blackgroundLock.dispose();if(win.options.scrollWin)windowSide.removeEvent('scroll',windowEvents);windowSide.dispose();}}).start(closeMorph);}}}),'bottom');windowTitlePane.adopt(windowButtonPane);windowTitlePane.adopt(new Element('span',{id:this.winIconId,'class':this.options.winIconCss}),'bottom');windowTitlePane.appendText(this.options.title);windowInside.adopt(windowTitlePane,'top');windowInside.adopt(win.windowContext,'bottom');var dragSizePanel=new Element('div',{'class':'dragSizePanel'});var dragSizeOperate=new Element('a',{'class':'dragSizeOperate',events:{mousedown:function(event){var dragDiv=new Element('div',{id:'drag_'+win.windowContextId,'html':'&nbsp;',styles:{'background-image':'url(/script/images/b.png)','left':windowSide.getStyle('left'),'top':windowSide.getStyle('top'),'width':windowSide.getStyle('width'),'height':windowSide.getStyle('height'),'z-index':110}});window.document.body.appendChild(dragDiv);var myDrag=dragDiv.makeDraggable({onBeforeStart:function(element){element.setStyle('width',windowSide.getStyle('width'));element.setStyle('height',getWindowHeight());},onStart:function(){this.element.setStyle('opacity',1);},onDrag:function(element){var h=element.getStyle('top').toInt()-windowSide.getStyle('top').toInt()+getWindowHeight()+30;var w=element.getStyle('left').toInt()-windowSide.getStyle('left').toInt()+windowSide.getStyle('width').toInt();if(w<120)w=120;element.setStyle('top',windowSide.getStyle('top'));element.setStyle('left',windowSide.getStyle('left'));element.setStyle('width',w);if(h<52)h=52;element.setStyle('height',(h-30));},onComplete:function(){this.element.setStyle('opacity',.5);var w=this.element.getStyle('width').toInt();var h=this.element.getStyle('height').toInt();if(h<wincontHC)h=wincontHC;windowSide.setStyle('width',w);windowSide.setStyle('height',h);windowInside.setStyle('width',w-10);windowInside.setStyle('height',h-10);win.windowContext.setStyle('width',w-10);win.windowContext.setStyle('height',h-wincontHC);var dlgContentPanel=win.windowContext.getElement("div.jdialogContentPanel");if(dlgContentPanel)
{dlgContentPanel.setStyle('height',h-wincontHC-23);}
var iframeEl=win.windowContext.getElement('iframe');if(iframeEl)
{iframeEl.setStyle('height',h-wincontHC);iframeEl.setStyle('width',w-10+'px');}
this.element.destroy();},onCancel:function(){this.element.destroy();}});myDrag.start(event);}}});dragSizePanel.adopt(dragSizeOperate,'bottom');windowSide.adopt(windowInside);windowSide.adopt(dragSizePanel,'bottom');this.beginLoading();var iWin=$$('.windowSide').length;if(this.options.left&&this.options.left>0)windowSide.setStyle('left',this.options.left);if(this.options.top&&this.options.top>0)windowSide.setStyle('top',this.options.top);if(this.options.move){windowSide.makeDraggable({handle:windowTitlePane,onStart:function(){this.element.setStyle('opacity',.5);window.document.body.selectedIndex=0;},onComplete:function(){if(windowSide.getStyle('left').toInt()<0)windowSide.setStyle('left',0);var maxWidth=document.body.clientWidth?document.body.clientWidth:screen.width;if(windowSide.getStyle('left').toInt()+windowSide.getStyle('width').toInt()>maxWidth)
windowSide.setStyle('left',maxWidth-windowSide.getStyle('width').toInt());if(windowSide.getStyle('top').toInt()<0)windowSide.setStyle('top',0);this.element.setStyle('opacity',1);}});}
if(!this.options.resize){windowTitlePane.setStyle('cursor','auto');dragSizeOperate.setStyle('display','none');}
this.setMessage(this.options.url,this.options.message);if(this.options.width=='auto'&&this.options.height=='auto')
{this.options.height=50;this.options.width=window.screen.availWidth/3;}
if(this.options.width&&this.options.width!='auto'){windowSide.setStyle("width",this.options.width);windowInside.setStyle("width",this.options.width.toInt()-10);}else
{var tmpWidth=windowInside.getStyle("width").toInt()+50;if(tmpWidth<100||(Browser.name=='ie'&&Browser.version==6))tmpWidth=window.screen.availWidth/3;if(tmpWidth<140)tmpWidth=140;windowSide.setStyle("width",tmpWidth);windowInside.setStyle("width",tmpWidth-10);}
if(!this.options.pop&&this.options.left==0&&this.options.top==0)
{windowSide.centerPosition(iWin*8);}else{if(this.options.top)
windowSide.setStyle('top',this.options.top);if(this.options.left)
windowSide.setStyle('left',this.options.left);}
if(this.options.scrollWin)
{window.addEvent('scroll',windowEvents.bind(this));(function()
{fixedTop=windowSide.getStyle('top').toInt()-windowSide.getParentDocument().scrollTop.toInt();}).delay(200);}
windowSide.store('windowState',0);this.fireEvent('afterShow');},setMessage:function(url,msg){var win=this;if(url&&(!photoFileTypes.contains(url.getFileType())))
{if(url.startsWith('file:'))alert('协议错误,你需要使用http协议,you need http');var ajax=new Request({url:url,method:'GET',onComplete:this.options.onComplete,onSuccess:function(html)
{win.windowContext.empty();win.windowContext.set('html',html);},onFailure:function(html){win.windowContext.empty();win.windowContext.set('html',html);}});ajax.send();}else{win.windowContext.empty();if(msg&&typeOf(msg)=='element'){if(msg.tagName.toLowerCase()=="iframe")msg.setStyle('margin-bottom','20px');win.windowContext.adopt(msg);}
else if(msg&&typeOf(msg)=='array'){msg.each(function(e){if(typeOf(e)=='element')
{if(e.tagName.toLowerCase()=="iframe")e.setStyle('margin-bottom','20px');win.windowContext.adopt(e);}
else win.windowContext.appendText(e);});}
else if(msg&&!photoFileTypes.contains(msg.getFileType()))
{win.windowContext.set('html',msg);}else{win.windowContext.adopt(new Element("img",{src:msg,border:'0'}));}}},close:function(){var closeEl=$(this.closeWindowsId);if(closeEl)closeEl.fireEvent('click');},maxClick:function()
{var maxEl=$(this.maxWindowId);if(maxEl)maxEl.fireEvent('click');},isClose:function(){return!$(this.windowSideId);},setPosition:function(x,y)
{var winDiv=$(this.windowSideId);if(winDiv)
{winDiv.setStyle('top',x);winDiv.setStyle('left',y);}},cssInit:function(){if(typeOf(this.options.windowCss)=='string')
this.options.windowCss=$$(this.options.windowCss);this.options.windowCss.each(function(e){e.set('url',e.get('href'));e.set('href','javascript:void(0);');e.onclick=function(){var jWin=new JWindow({title:'URL连接页面对话框',url:e.get('url')});jWin.show();};});}});var JDialog=new Class({Extends:JWindow,initialize:function(options){if(options.minButton==undefined)options.minButton=false;this.parent(options);}});JDialog.Pop=new Class({Extends:JDialog,initialize:function(options){options.resize=false;if(!options.width)options.width=220;if(!options.height)options.height=180;var infoDiv=new Element('div',{'class':'jdialogContentPanel'});if(typeOf(options.message)=='element')infoDiv.adopt(options.message);else infoDiv.set('html',options.message);options.message=infoDiv;options.scrollClose=true;options.scrollWin=false;options.pop=true;if(options.sleep==undefined)options.sleep=5000;this.parent(options);this.close.delay(options.sleep,this);}});JDialog.Confirm=new Class({Extends:JDialog,initialize:function(options){options.resize=false;if(!options.okButtionCaption)options.okButtionCaption='确定';if(!options.noButtionCaption)options.noButtionCaption='取消';var win=this;var buttonPane=new Element('div',{'class':'jdialogButtonPanel'});buttonPane.adopt(new Element('button',{type:'button',html:options.okButtionCaption,'class':'jdialog-ok-button',events:{click:function(){win.options.callback(true);win.close();}}}));buttonPane.adopt(new Element('button',{type:'button',html:options.noButtionCaption,'class':'jdialog-no-button',events:{click:function(){if(options.callback)
options.callback(false);win.close();}}}));var msgArray=[];var jdialogContentPanel=new Element('div',{'class':'jdialogContentPanel'});if(typeOf(options.message)=='element')
jdialogContentPanel.adopt(options.message);else
jdialogContentPanel.set('html',options.message)
msgArray.push(jdialogContentPanel);msgArray.push(buttonPane);options.message=msgArray;this.parent(options);}});JDialog.Prompt=new Class({Extends:JDialog,initialize:function(options){if(!options.okButtionCaption)options.okButtionCaption='确定';if(!options.noButtionCaption)options.noButtionCaption='取消';var win=this;var buttonPane=new Element('div',{'class':'jdialogButtonPanel'});buttonPane.adopt(new Element('button',{type:'button',html:options.okButtionCaption,'class':'jdialog-ok-button',events:{click:function(){if(options.callback)options.callback($(win.windowContextId));win.close();}}}));buttonPane.adopt(new Element('button',{type:'button','html':options.noButtionCaption,'class':'jdialog-no-button',events:{click:function(){win.close();}}}));var msgArray=new Array();var jdialogContentPanel=new Element('div',{'class':'jdialogContentPanel'});if(typeOf(options.message)=='element'){jdialogContentPanel.adopt(options.message.clone());}
else{jdialogContentPanel.set('html',options.message);}
if(!options.message)jdialogContentPanel.adopt(new Element('input',{type:'text'}));msgArray.push(jdialogContentPanel);msgArray.push(buttonPane);options.message=msgArray;this.parent(options);}});JDialog.Color=new Class({Extends:JDialog,initialize:function(options){options.resize=false;if(!options.title)options.title='颜色对话框 Color Dialog';if(!options.okButtionCaption)options.okButtionCaption='确定';if(!options.noButtionCaption)options.noButtionCaption='取消';var win=this;var clr=new Array('00','30','60','90','a0','c0','ff');var colorPane=new Element('div',{'class':'jdialog_colorPanel'});var bspan=new Element('span',{html:'&nbsp;'});colorPane.adopt(bspan);var inputEl=new Element('input',{type:'text','class':'jdialog_colorInput'});for(var r=0;r<7;r++)
for(var g=0;g<7;g++)
for(var b=0;b<7;b++){var col='#'+clr[6-r]+clr[6-g]+clr[6-b];colorPane.adopt(new Element('div',{styles:{'background-color':col},events:{click:function(){var cspan=colorPane.getElement("span");var color=this.getStyle('background-color').toUpperCase();bspan.setStyle("background-color",color);inputEl.set('value',color);var white=new Color(color);cspan.setStyle('color',white.invert());}}}));}
var buttonPane=new Element('div',{'class':'jdialogButtonPanel'});buttonPane.adopt(inputEl);buttonPane.adopt(new Element('button',{type:'button','html':options.okButtionCaption,'class':'jdialog-ok-button',events:{click:function(){var cspan=colorPane.getElement("span");options.callback(cspan.getStyle('background-color'));win.close();}}}));buttonPane.adopt(new Element('button',{type:'button',html:options.noButtionCaption,'class':'jdialog-no-button',events:{click:function(){win.close();}}}));var msgArray=new Array();var jdialogContentPanel=new Element('div',{'class':'jdialogContentPanel'});jdialogContentPanel.adopt(colorPane);msgArray.push(jdialogContentPanel);msgArray.push(buttonPane);options.width=430;options.message=msgArray;this.parent(options);}});JDialog.Alert=new Class({Extends:JDialog,initialize:function(options){var win=this;if(!options.title)options.title='提示对话框 Alert Dialog';if(!options.okButtionCaption)options.okButtionCaption='关闭';var buttonPane=new Element('div',{'class':'jdialogButtonPanel'});buttonPane.adopt(new Element('button',{type:'button',html:options.okButtionCaption,'class':'jdialog-ok-button',events:{click:function(){if(options.callback)options.callback(true);win.close();}}}));var msgArray=new Array();if(typeOf(options.message)=='string'){var fileName=options.message;var ext=fileName.getFileType();if(photoFileTypes.contains(ext)){options.message=new Element('img',{src:fileName,border:0});var addFref=false;if(options.message.width>options.width){options.message.set('width',(options.width-10));addFref=true;}
if(options.message.height>500){options.message.set('height',480);addFref=true;}
if(addFref){var ael=new Element('a',{href:fileName,target:'_blank'});ael.adopt(options.message);options.message=ael;}}}
var jdialogContentPanel=new Element('div',{'class':'jdialogContentPanel'});if(typeOf(options.message)=='element')
{jdialogContentPanel.adopt(options.message);}
else jdialogContentPanel.set('html',options.message);msgArray.push(jdialogContentPanel);msgArray.push(buttonPane);options.message=msgArray;this.parent(options);}});var JFloatingPanel=new Class({Implements:Options,options:{title:'浮动窗口',float:'right',top:100,width:160,content:'',interval:0,openAction:'mouseenter',closeAction:'mouseleave',sideBar:'<span style="font-size:24px; font-weight:bold;color:#FFF;">&sect;</span>',background:'#F93',display:'none'},initialize:function(options){this.setOptions(options);if(typeOf(this.options.content)=='string')
this.options.content=$(this.options.content);var floatingPanel=new Element('div',{"class":"floatingPanel"});var floatingSideBar=new Element('div',{"class":"floatingSideBar",styles:{'background':this.options.background}});if(typeOf(this.options.sideBar)=='element')
{floatingSideBar.adopt(this.options.sideBar);}else{floatingSideBar.set('html',this.options.sideBar);}
floatingPanel.setStyle('top',this.options.top);var floatingPanelContent=new Element('div',{"class":"floatingMainBar"});floatingPanelContent.setStyles({'width':this.options.width,'background':this.options.background});if(this.options.float=='left')
{floatingSideBar.setStyle('float','right');floatingPanel.setStyle('left',this.options.interval);}else{floatingSideBar.setStyle('float','left');floatingPanel.setStyle('right',this.options.interval);}
var topPanel=new Element('div',{"class":"topPanel"});var titPanel=new Element('div',{"class":"titPanel",'html':this.options.title});floatingPanelContent.adopt(topPanel);floatingPanelContent.adopt(titPanel);floatingPanelContent.setStyle('display','none');var conPanel=new Element('div',{"class":"conPanel"});conPanel.adopt(this.options.content);floatingPanelContent.adopt(conPanel);var endPanel=new Element('div',{"class":"endPanel"});floatingPanel.adopt(floatingSideBar);floatingPanel.adopt(floatingPanelContent);floatingPanel.adopt(endPanel);window.document.body.adopt(floatingPanel);floatingSideBar.addEvent(this.options.openAction,function(){floatingPanelContent.setStyle('display','');floatingSideBar.setStyle('display','none');});floatingPanelContent.addEvent(this.options.closeAction,function(){floatingSideBar.setStyle('display','');floatingPanelContent.setStyle('display','none');});}});var JSmartFloat=new Class({Implements:Options,options:{element:''},initialize:function(options){this.setOptions(options);if(typeOf(this.options.element)=='string')this.options.element=$(this.options.element);var element=this.options.element;var position=function(element){var top=element.getPosition().y;var left=element.getPosition().x;window.addEvent("scroll",function(){var scrolls=this.getScroll().y;if(scrolls>top){if(window.XMLHttpRequest){element.setStyles({position:"fixed",left:left,top:0});}else{element.setStyles({top:scrolls,left:left});}}else{element.setStyles({position:"absolute",left:left,top:top});}});};if(typeOf(element)=="elements"){return element.each(function(items){position(items);});}else if(typeOf(element)=="element"){position(element);}}});var JTabs=new Class({Implements:Options,options:{buttons:false,buttonCss:'buttonCss',buttonCurrentCss:'buttonCurrentCss',contexts:false,eventAction:'click',highlight:'#FF9',varName:'tabIndex',current:0},initialize:function(options){this.setOptions(options);var tab=this;if(typeOf(this.options.buttons)=='string')
this.options.buttons=$$(this.options.buttons);if(typeOf(this.options.contexts)=='string')
this.options.contexts=$$(this.options.contexts);this.options.buttons.each(function(button,index){button.store(tab.options.varName,index);button.addEvent(tab.options.eventAction,function(){tab.options.current=button.retrieve(tab.options.varName);tab.options.buttons.each(function(btn,actionIndex){if(tab.options.current==actionIndex){tab.options.contexts[actionIndex].setStyle('display','');btn.set('class',tab.options.buttonCurrentCss);}else{tab.options.contexts[actionIndex].setStyle('display','none');btn.set('class',tab.options.buttonCss);}});});});this.setCurrent(this.options.current);},setCurrent:function(current){var button=this.options.buttons[current];if(typeOf(button)=='element')
button.fireEvent(this.options.eventAction);},getCurrent:function(){return this.options.current;}});function selectAll(id,name){if(typeOf(id)=='string')
id=$(id);var inputs=id.getElements('input');inputs.each(function(e){if(e.get('name')==name)
e.set('checked','checked');});}
function selectedConvert(id,name){if(typeOf(id)=='string')
id=$(id);var inputs=id.getElements('input');inputs.each(function(e){if(e.get('name')==name){if(e.get('checked')=='checked'||e.get('checked')=='')
e.set('checked','checked');else e.set('checked','');}});}
function selectedValues(elId){var result=[];var inputs=elId;if(typeOf(elId)=='string')inputs=$$(elId);if(inputs)inputs.each(function(e){if(e.get('checked'))
result.push(e.get('value'));});return result;}
var JScrollPanel=new Class({Implements:[Events,Options],options:{container:$('div.scrollDiv'),button:$('div.scrollButton'),textPanelCss:'titlePanel',currentCss:'selected',motion:'scroll',buttonTransition:'elastic:out',titleTransition:'elastic:out',duration:'normal',titleHeight:100,buttonHeight:50,buttonWidth:50,jsonData:false,marginWidth:1,scrollWidth:false,data:[],arrowPrevious:false,arrowNext:false,arrowButton:true,arrowLeftImg:'/share/icon/arrow_left.gif',arrowRightImg:'/share/icon/arrow_right.gif',arrowWidth:28,play:true,statusBar:false,buttonTemplate:false,playInfo:'播放',stopInfo:'停止',currentStep:0,currentPage:1,sleep:4000,showArrow:true,buttonEvent:'click',showTitle:true},initialize:function(options){this.setOptions(options);if(typeof(this.options.container)=='string')
this.options.container=$(this.options.container);if(typeof(this.options.button)=='string')
this.options.button=$(this.options.button);if(this.options.statusBar&&typeof(this.options.statusBar)=='string')
this.options.statusBar=$(this.options.statusBar);if(typeof(this.options.data)=='string')this.options.data=$$(this.options.data);this.scrollWidth=this.options.scrollWidth;this.currentPage=this.options.currentPage;this.buttonTemplate=this.options.buttonTemplate;if(!this.buttonTemplate)this.buttonTemplate=this.options.button.get('html');this.loadData(this.options.data);this.setCurrentStep(this.options.currentStep);if(this.options.play)this.play();},loadData:function(data){if(data!=undefined)this.options.data=data;if(!this.options.data)return;this.buttonWidth=this.options.buttonWidth;var cs=this;this.buttonJson=this.options.jsonData;if(!this.buttonJson)
{this.buttonJson=[];for(var i=0;i<cs.options.data.length;i++)
{var btn={};btn.image=cs.options.data[i].get("image");btn.title=cs.options.data[i].get("title");btn.link=cs.options.data[i].get("link");btn.target=cs.options.data[i].get("target");btn.html=cs.options.data[i].get("html");btn.index=i;btn.sort=(i+1);this.buttonJson.include(btn);}}
this.buttonLength=this.buttonJson.length;this.options.button.empty();this.buttonUlPanel=new Element('ul',{'class':'scroll'});this.buttonScrollPanel=new Element('div',{'class':'scrollPanel'});this.buttonScrollPanel.adopt(this.buttonUlPanel);var tempLi=false;for(var i=0;i<this.buttonJson.length;i++)
{var liDiv=new Element('li',{'styles':{'height':this.options.buttonHeight,'width':this.options.buttonWidth}});liDiv.set('html',this.buttonTemplate.substitute(this.buttonJson[i]));liDiv.set('link',this.buttonJson[i].link);liDiv.set('sort',this.buttonJson[i].sort);liDiv.set('index',this.buttonJson[i].index);liDiv.set('target',this.buttonJson[i].target);liDiv.addEvent(this.options.buttonEvent,function(){var goInd=this.get('index').toInt();if(goInd!=cs.options.currentStep)cs.setCurrentStep(this.get('index').toInt());});this.buttonUlPanel.adopt(liDiv);if(!tempLi)tempLi=liDiv;}
if(tempLi==null)return;this.options.button.addEvents({'mouseenter':function(){cs.stop();},'mouseleave':function(){cs.play();}});if(cs.options.arrowPrevious)
{$(cs.options.arrowPrevious).addEvent('click',function(){cs.previous();});}
if(cs.options.arrowNext)
{$(cs.options.arrowNext).addEvent('click',function(){cs.next();});}
if(cs.options.arrowButton)
{this.arrowLeft=new Element('a',{'class':'left',styles:{'opacity':0.8,'float':'left','width':this.options.arrowWidth,'height':this.options.buttonHeight,'background':'url("'+this.options.arrowLeftImg+'") no-repeat'},'events':{'click':function(){cs.setPlayStatus(false);cs.currentPage=cs.currentPage-1;if(cs.currentPage<1)cs.currentPage=1;cs.setImgPage(cs.currentPage);},'mouseover':function(){this.setStyle('opacity',1);},'mouseleave':function(){this.setStyle('opacity',0.8);}}});this.arrowRight=new Element('a',{'class':'right',styles:{'opacity':0.8,'float':'right','width':this.options.arrowWidth,'height':this.options.buttonHeight,'background':'url("'+this.options.arrowRightImg+'") no-repeat'},'events':{'click':function(){cs.setPlayStatus(false);cs.currentPage=cs.currentPage+1;if(cs.currentPage>cs.buttonMaxPage)cs.currentPage=cs.buttonMaxPage;cs.setImgPage(cs.currentPage);},'mouseover':function(){this.setStyle('opacity',1);},'mouseleave':function(){this.setStyle('opacity',0.8);}}});this.options.button.adopt(this.arrowLeft);this.options.button.adopt(this.arrowRight);}
this.options.button.adopt(this.buttonScrollPanel);this.contentWidth=this.options.container.getWidth();this.buttonPanelWidth=this.options.button.getWidth();if(!this.buttonPanelWidth)this.buttonPanelWidth=this.contentWidth>0?this.contentWidth:window.screenX/3;if(!cs.options.arrowButton)this.showButtonSize=parseInt(Math.ceil(this.buttonPanelWidth/(this.buttonWidth+this.options.marginWidth)));else this.showButtonSize=parseInt(Math.ceil((this.buttonPanelWidth-(this.options.arrowWidth*2))/(this.buttonWidth+this.options.marginWidth)));if(!cs.options.arrowButton)this.buttonShowWidth=this.buttonPanelWidth;else this.buttonShowWidth=this.buttonPanelWidth-(this.options.arrowWidth*2);this.buttonMaxPage=Math.ceil(this.buttonLength/this.showButtonSize);if(!this.scrollWidth)this.scrollWidth=(this.buttonPanelWidth+this.options.marginWidth)*this.buttonLength;if(Browser.name=='ie'&&Browser.version==6)this.scrollWidth=this.scrollWidth+this.buttonLength;//屏蔽按钮层宽度//this.buttonUlPanel.setStyle('width',this.scrollWidth);
this.buttonFx=new Fx.Morph(this.buttonUlPanel,{link:'cancel',duration:this.options.duration,transition:this.options.buttonTransition});this.titleDiv=new Element('div',{'class':this.options.textPanelCss});this.titleFx=new Fx.Morph(this.titleDiv,{link:'cancel',duration:this.options.duration,transition:this.options.titleTransition});this.titleFx.set({'height':0,'width':this.contentWidth,'display':'none'});this.container=this.options.container.clone();this.container.addClass('contentScrollPanel');this.container.setStyle('float','left');this.cacheContainer=this.options.container.clone();this.cacheContainer.addClass('cacheContainer');this.cacheContainer.setStyle('float','left');this.scrollContainer=new Element('div',{'class':'scrollContainer','styles':{'width':(this.contentWidth*2),'float':'left'}});this.scrollContainer.adopt(this.container);this.scrollContainer.adopt(this.cacheContainer);this.options.container.empty();this.options.container.adopt(this.scrollContainer);this.options.container.setStyle('overflow','hidden');this.container.addEvents({'mouseenter':function(){if(cs.options.showTitle)
{cs.titleFx.start({'display':'','height':cs.options.titleHeight});}
cs.stop();},'mouseleave':function(){if(cs.options.showTitle&&cs.titleDiv)
{(function()
{if(Browser.name=='ie'){cs.titleDiv.setStyles({'height':0,'display':'none'});}else{cs.titleFx.start({'height':0,'display':'none'});}}).delay(200,cs);}
cs.play();},'click':function(){var link=this.get("link");var target=this.get("target");if(link!=null&&link!=''&&link!='#')
{if(link.startsWith('javascript:'))
{eval(link.substringAfter(":"));}else
{if(target==''||target=='_self')window.location=link;else window.open(link,target);}}}});if(this.options.showArrow==false)this.options.button.setStyle('display','none');this.fireEvent('load',this);},setCurrentStep:function(current){var oldCurrentStep=this.options.currentStep;if(current==undefined)current=this.options.currentStep;else this.options.currentStep=current;var cs=this;var buttons=this.buttonUlPanel.getElements('li');if(!buttons)return;buttons.removeClass(this.options.currentCss);if(!buttons[current])return;if(this.options.currentCss)
buttons[current].addClass(this.options.currentCss);if(this.options.motion=='scroll')
{this.cacheFx=new Fx.Morph(this.scrollContainer,{duration:'normal',onStart:function()
{cs.cacheContainer.set('html',cs.buttonJson[buttons[current].get('index').toInt()].html);cs.container.set("link",buttons[current].get('link'));},onComplete:function(){var cur=buttons[current];if(!cur)return;cs.container.set('html',cs.buttonJson[cur.get('index').toInt()].html);if(cs.options.showTitle&&cs.titleFx&&cs.titleDiv)
{var tit=cs.buttonJson[cur.get('index').toInt()].title;if(tit)cs.titleDiv.set('html',tit);cs.container.grab(cs.titleDiv,'top');}
if(cs.container.getStyle('float')=='left')
{cs.container.setStyle('float','right');}else
cs.container.setStyle('float','left');var thePage=parseInt(current/cs.showButtonSize);if(thePage*cs.showButtonSize<=current)thePage=thePage+1;if(cs.currentPage!=thePage)cs.setImgPage(thePage);cs.fireEvent('scrollChange',cs);}});var leftStart=0;var leftEnd=-this.contentWidth;if(oldCurrentStep<current||oldCurrentStep==current==1)
{this.container.setStyle('float','left');leftStart=0;leftEnd=-this.contentWidth;}else
if(oldCurrentStep>current)
{this.container.setStyle('float','right');leftStart=-this.contentWidth;leftEnd=0;}else return;this.cacheFx.start({'margin-left':[leftStart,leftEnd]});}
else if(this.options.motion=='fade')
{var containerFx=new Fx.Tween(cs.container,{property:'opacity',duration:'normal',onStart:function()
{cs.container.setStyle('opacity',0.8);cs.cacheContainer.set('html',cs.buttonJson[buttons[current].get('index').toInt()].html);cs.container.set("link",buttons[current].get('link'));cs.container.set('html',cs.buttonJson[buttons[current].get('index').toInt()].html);},onComplete:function(){var thePage=parseInt(current/cs.showButtonSize);if(thePage*cs.showButtonSize<=current)thePage=thePage+1;if(cs.currentPage!=thePage)cs.setImgPage(thePage);cs.fireEvent('scrollChange',cs);}});containerFx.start([0.4,1]);}
else
{cs.cacheContainer.set('html',cs.buttonJson[buttons[current].get('index').toInt()].html);cs.container.set('html',cs.cacheContainer.get('html'));cs.container.set("link",buttons[current].get('link'));var thePage=parseInt(current/cs.showButtonSize);if(thePage*cs.showButtonSize<=current)thePage=thePage+1;if(cs.currentPage!=thePage)cs.setImgPage(thePage);cs.fireEvent('scrollChange',cs);}},setPlayStatus:function(play)
{this.options.playStatus=play;if(this.options.statusBar&&this.options.playInfo&&this.options.stopInfo)
{if(this.options.playStatus)
this.options.statusBar.set('html',this.options.playInfo);else
this.options.statusBar.set('html',this.options.stopInfo);}},getCurrentStep:function(){return this.options.currentStep;},timer:function(){if(!this.options.play)return;this.next();},play:function(){if(this.periodical)return;this.setPlayStatus(true);this.periodical=this.timer.periodical(this.options.sleep,this);},isStop:function()
{return!this.options.playStatus;},stop:function(){this.setPlayStatus(false);if(this.periodical)clearInterval(this.periodical);this.periodical=null;},playAndStop:function(){if(this.options.playStatus)this.stop();else this.play();return this.options.playStatus;},previous:function(){var current=this.options.currentStep-1;if(current<0)current=(this.buttonLength-1);this.setCurrentStep(current);},next:function(){var current=this.options.currentStep.toInt()+1;if(current>=this.buttonLength)current=0;this.setCurrentStep(current);},clickPrevious:function(){this.stop();this.previous();},clickNext:function(){this.stop();this.next();},clickPreviousPage:function(){this.stop();this.setImgPage(this.currentPage-1);},clickNextPage:function(){this.stop();this.setImgPage(this.currentPage+1);},setImgPage:function(buttonPage){var page=buttonPage-1;if(!page||page<=0)page=0;if(page>this.buttonMaxPage-1)page=this.buttonMaxPage-1;var move=page*this.buttonShowWidth;this.buttonFx.start({'margin-left':-move});this.currentPage=(page+1);},close:function()
{this.options.container.destroy();this.options.button.destroy();}});var JMarquee=new Class({Implements:[Events,Options],options:{container:'',button:false,currentCss:'selected',textPanelCss:'titlePanel',titleTransition:'back:in',transition:'linear',duration:'normal',direction:false,titleHeight:100,blockWidth:100,marginWidth:1,scrollWidth:false,data:[],arrowPrevious:false,arrowNext:false,arrowButton:true,arrowLeftImg:'/share/icon/arrow_left.gif',arrowRightImg:'/share/icon/arrow_right.gif',play:true,playMode:true,statusBar:false,playInfo:'播放',stopInfo:'停止',buttonEvent:'mouseenter',currentStep:1,sleep:4000,showArrow:true,showTitle:true},initialize:function(options){this.setOptions(options);if(typeof(this.options.container)=='string')
this.options.container=$(this.options.container);if(typeof(this.options.button)=='string')
this.options.button=$(this.options.button);if(this.options.statusBar&&typeof(this.options.statusBar)=='string')
this.options.statusBar=$(this.options.statusBar);if(typeof(this.options.data)=='string')
this.options.data=$$(this.options.data);this.scrollWidth=this.options.scrollWidth;this.loadData(this.options.data);this.setImgPage(this.options.currentStep);if(this.options.play)this.play();},loadData:function(data){if(data==undefined)return;this.options.data=data;if(!this.options.data)return;this.blockWidth=this.options.blockWidth;this.buttonJson=[];var cs=this;for(var i=0;i<cs.options.data.length;i++)
{var btn={};btn.image=cs.options.data[i].get("image");btn.title=cs.options.data[i].get("title");btn.link=cs.options.data[i].get("link");btn.target=cs.options.data[i].get("target");btn.index=i;btn.sort=(i+1);this.buttonJson.include(btn);}
this.buttonLength=this.buttonJson.length;this.options.container.empty();this.ulPanel=new Element('ul',{'class':'scroll'});this.scrollPanel=new Element('div',{'class':'scrollPanel'});this.scrollPanel.adopt(this.ulPanel);this.titles=new Array(this.buttonJson.length);var closeTitle=function(){var ind=this.get('index');(function()
{var titleDiv=cs.titles[ind];if(titleDiv)
{titleDiv.morph({'height':0,'display':'none'});}}).delay(200,cs);cs.play();};var tempLi=false;for(var i=0;i<this.buttonJson.length;i++)
{var liDiv=new Element('li');this.ulPanel.adopt(liDiv);liDiv.set('html',this.options.data[i].get('html'));liDiv.set('link',this.buttonJson[i].link);liDiv.set('sort',this.buttonJson[i].sort);liDiv.set('target',this.buttonJson[i].target);liDiv.set('index',this.buttonJson[i].index);if(cs.options.showTitle)
{var titleDiv=new Element('div',{'class':this.options.textPanelCss,'html':this.buttonJson[i].title});titleDiv.set('index',this.buttonJson[i].index);liDiv.grab(titleDiv,'top');titleDiv.set('morph',{duration:'long',link:'cancel',transition:'bounce:out'});titleDiv.setStyles({'height':0,'width':this.blockWidth,'position':'absolute','z-index':1,'display':'none'});this.titles[this.buttonJson[i].index]=titleDiv;liDiv.addEvent('mouseenter',function(){var ind=this.get('index');if(cs.options.showTitle)
{var titleDiv=cs.titles[ind];if(titleDiv){titleDiv.morph({'display':'','height':cs.options.titleHeight});}}
cs.stop();});liDiv.addEvent('mouseleave',closeTitle);titleDiv.addEvent('mouseleave',closeTitle);}
if(this.buttonJson[i].link&&this.buttonJson[i].link!='#')
{liDiv.addEvent('click',function(){var link=this.get("link");var target=this.get("target");if(link!=null&&link!=''&&link!='#')
{if(link.startsWith('javascript:'))
{eval(link.substringAfter(":"));}else
{if(target==''||target=='_self')
window.location=link;else
window.open(link,target);}}});}
if(!tempLi)tempLi=liDiv;}
if(!tempLi)return;this.options.container.addEvents({'mouseenter':function(){cs.stop();},'mouseleave':function(){if(cs.options.showTitle)
{(function()
{if(Browser.name=='ie'){cs.titleFx.set({'height':0,'display':'none'});}else{cs.titleFx.start({'height':0,'display':'none'});}}).delay(200,cs);}
cs.play();}});if(cs.options.arrowPrevious)
{$(cs.options.arrowPrevious).addEvent('click',function(){cs.previous();});}
if(cs.options.arrowNext)
{$(cs.options.arrowNext).addEvent('click',function(){cs.next();});}
var img=new Image();img.src=this.options.arrowLeftImg;if(!this.options.arrowButton)img.width=0;this.options.container.adopt(this.scrollPanel);this.contentWidth=this.options.container.getWidth();this.showButtonSize=parseInt(Math.ceil(this.contentWidth/(this.blockWidth+this.options.marginWidth)));this.buttonMaxPage=Math.ceil(this.buttonLength/this.showButtonSize);if(!this.scrollWidth)this.scrollWidth=this.showButtonSize*(this.blockWidth+this.options.marginWidth);if(this.options.button)
{this.menuPanel=new Element('ul',{'class':'scroll'});var leftLiDiv=new Element('span',{'class':'left'});var leftDiv=new Element('a',{'href':'javascript:void(0)','class':'left',styles:{'float':'left'},'html':'◄'});leftLiDiv.adopt(leftDiv);leftDiv.addEvent('click',function(){cs.previous();});this.menuPanel.adopt(leftLiDiv);for(var i=1;i<=this.buttonMaxPage;i++)
{var liDiv=new Element('li');var aDiv=new Element('a',{'href':'javascript:void(0)'});liDiv.adopt(aDiv);aDiv.set('pageIndex',i);aDiv.addEvent(cs.options.buttonEvent,function(){var pageIndex=this.get("pageIndex");if(pageIndex)
cs.setImgPage(pageIndex);});this.menuPanel.adopt(liDiv);}
this.options.button.adopt(this.menuPanel);var rightLiDiv=new Element('span',{'class':'right'});var rightDiv=new Element('a',{'href':'javascript:void(0)','class':'right','html':'►'});rightLiDiv.adopt(rightDiv);rightDiv.addEvent('click',function(){cs.next();});this.menuPanel.adopt(rightLiDiv);this.menuPanel.addEvents({'mouseenter':function(){cs.stop();},'mouseleave':function(){cs.play();}});}
this.scrollPanel.setStyle('width',this.contentWidth);var fullWidth=(this.blockWidth+this.options.marginWidth)*this.buttonLength;if(Browser.name=='ie'&&Browser.version==6)fullWidth=fullWidth+this.buttonLength;this.ulPanel.setStyle('width',fullWidth);this.buttonFx=new Fx.Morph(this.ulPanel,{link:'cancel',duration:this.options.duration,transition:this.options.transition});if(this.options.showTitle)
{this.titleDiv=new Element('div',{'class':this.options.textPanelCss});this.titleFx=new Fx.Morph(this.titleDiv,{link:'cancel',duration:this.options.duration,transition:this.options.titleTransition});}
this.options.container.setStyle('overflow','hidden');this.fireEvent('load',this);},setPlayStatus:function(play)
{this.options.play=play;if(this.options.statusBar)
{if(this.options.play)
this.options.statusBar.set('html',this.options.playInfo);else
this.options.statusBar.set('html',this.options.stopInfo);}},timer:function(){if(!this.options.play)return;if(this.options.direction)this.previous();else this.next();},previous:function(){this.options.currentStep=this.options.currentStep-1;if(this.options.currentStep<1)this.options.currentStep=this.buttonMaxPage;this.setImgPage(this.options.currentStep);this.stop();this.play();},next:function(){this.options.currentStep=this.options.currentStep+1;if(this.options.currentStep>this.buttonMaxPage)this.options.currentStep=1;this.setImgPage(this.options.currentStep);this.stop();this.play();},play:function(){if(this.options.play&&this.periodical)return;if(!this.options.playMode)return false;this.setPlayStatus(true);this.periodical=this.timer.periodical(this.options.sleep,this);},playAndStop:function(){if(this.options.play)this.stop();else this.play();return this.options.play;},isStop:function()
{return!this.options.play;},stop:function(){this.setPlayStatus(false);if(this.periodical)clearInterval(this.periodical);this.periodical=null;},setImgPage:function(buttonPage){var page=buttonPage-1;if(page<=0)page=0;if(page>this.buttonMaxPage-1)page=this.buttonMaxPage-1;var move=page*this.scrollWidth;if(move<this.blockWidth)move=0;this.buttonFx.start({'margin-left':-move});this.options.currentStep=buttonPage;var leArray=this.menuPanel.getElements('li');if(leArray)
{leArray.removeClass(this.options.currentCss);if(leArray[(this.options.currentStep-1)])
leArray[(this.options.currentStep-1)].addClass(this.options.currentCss);}},getCurrentStep:function()
{return this.options.currentStep;}});var LazyLoad=new Class({Implements:[Options,Events],options:{range:200,elements:"img",loaderImg:"/share/pimg/ajax-loader.gif",container:window,mode:"vertical",realSrcAttribute:"data-src"},initialize:function(options){this.setOptions(options);this.container=document.id(this.options.container);this.elements=document.id(this.container==window?document.body:this.container).getElements(this.options.elements);this.largestPosition=0;var axis=(this.options.mode=="vertical"?"y":"x");var offset=(this.container!=window&&this.container!=document.body?this.container:"");var ld=this;this.elements=this.elements.filter(function(el){if(el.tagName=='IMG'&&!el.getProperty('src'))el.setProperty('src',ld.options.loaderImg);var elPos=el.getPosition(offset)[axis];if(elPos<this.container.getSize()[axis]+this.options.range){this.loadImage(el);return false;}
return true;},this);var action=function(e){var cpos=this.container.getScroll()[axis];if(cpos>this.largestPosition){this.elements=this.elements.filter(function(el){if((cpos+this.options.range+this.container.getSize()[axis])>=el.getPosition(offset)[axis]){this.loadImage(el);return false;}
return true;},this);this.largestPosition=cpos;}
this.fireEvent("scroll");if(!this.elements.length){this.container.removeEvent("scroll",action);this.fireEvent("complete");}}.bind(this);this.container.addEvent("scroll",action);},loadImage:function(image){var dataSrc=image.get(this.options.realSrcAttribute);if(dataSrc)
{image.removeProperty(this.options.realSrcAttribute);image.setProperty("src",dataSrc);this.fireEvent("load",[image]);}}});function scrollToTop(acceleration,time){acceleration=acceleration||0.1;time=time||16;var x1=0;var y1=0;var x2=0;var y2=0;var x3=0;var y3=0;if(document.documentElement){x1=document.documentElement.scrollLeft||0;y1=document.documentElement.scrollTop||0;}
if(document.body){x2=document.body.scrollLeft||0;y2=document.body.scrollTop||0;}
var x3=window.scrollX||0;var y3=window.scrollY||0;var x=Math.max(x1,Math.max(x2,x3));var y=Math.max(y1,Math.max(y2,y3));var speed=1+acceleration;window.scrollTo(Math.floor(x/speed),Math.floor(y/speed));if(x>0||y>0){var invokeFunction="scrollToTop("+acceleration+", "+time+")";window.setTimeout(invokeFunction,time);}}
function bindGotoTop(gotoTop)
{if(typeOf(gotoTop)!='element')
{gotoTop=$(gotoTop)}
var gotoFx=new Fx.Morph(gotoTop);gotoTop.addEvent('click',function(e){scrollToTop();});window.addEvent('scroll',function(e){if(Browser.name=='ie'&&Browser.version==6)
{gotoTop.setStyles({'position':'absolute','bottom':window.getPosition().y+10});}
if(window.getScroll().y>220)
{gotoFx.start({'opacity':1,'height':53});}
else{gotoFx.start({'height':0,'opacity':0});}});}

window.addEvent('domready', function () {
       var p = $('qqPanel');
        if (p) 
        {
            $('displayQQBtn').addEvent('click', function () {
                var p = $('qqPanel');
                var d = p.getStyle('display');
               if (d=='none')
               {
                   if (Browser.name=='ie'&&(Browser.version==6|| Browser.version==7))
				   {
                       p.setStyle('display','');
				   }
                   else{
                        var pFx = new Fx.Morph(p);
                        pFx.start({'opacity':1,'display':''});
                   }
				   $('qStit').setStyle('display','none');	
               } else{
                  if (Browser.name=='ie'&&(Browser.version==6|| Browser.version==7))
                       p.setStyle('display','none');
                   else{
                       var pFx = new Fx.Morph(p);
                       pFx.start({'opacity':0,'display':'none'});
                   }
				   $('qStit').setStyle('display','');
               }
            });
               
        }

        var p = $('displayBLBtn');
        if (p) 
        {
            $('displayBLBtn').addEvent('click', function () {
                var p = $('bLPanel');
                var d = p.getStyle('display');
               if (d=='none')
               {
                   if (Browser.name=='ie'&&(Browser.version==6|| Browser.version==7))
                       p.setStyle('display','');
                   else{
                        var pFx = new Fx.Morph(p);
                        pFx.start({'opacity':1,'display':''});
                   }
				   $('bLtit').setStyle('display','none');	
               } else{
                  if (Browser.name=='ie'&&(Browser.version==6|| Browser.version==7))
                       p.setStyle('display','none');
                   else{
                       var pFx = new Fx.Morph(p);
                       pFx.start({'opacity':0,'display':'none'});
                   }
				   $('bLtit').setStyle('display','');
               }
            });
               
        }
	}); 

/*回到顶部*/
       var createGoTopPanel=function()
       {
           var gotoPanel = new Element('div',{'class':'gotoPanel'});
           var gotoTop = new Element('a',{'id':'gotoTop','class':'gotoTop'});
           bindGotoTop(gotoTop);
           gotoPanel.adopt(gotoTop);
		   document.body.appendChild(gotoPanel);
       }